[R] Import/export ENVI files

1 view
Skip to first unread message

Lucas Sevilla García

unread,
Aug 24, 2009, 8:12:07 AM8/24/09
to r-h...@r-project.org

Hi! I'm a beginner with this webpage so, I don't know if I'm sending my question to the correct site. Anyway, I'm working with R and I need to import and export ENVI files, (*.HDR files). A colleague told me that there is a package to import/export envi files but I haven't found that package, so does anyone know something about this? thank you so much :) . Ciaooo

_________________________________________________________________
[[elided Hotmail spam]]

[[alternative HTML version deleted]]

______________________________________________
R-h...@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Barry Rowlingson

unread,
Aug 24, 2009, 9:28:23 AM8/24/09
to Lucas Sevilla García, r-h...@r-project.org
2009/8/24 Lucas Sevilla García <lucko...@hotmail.com>:

>
> Hi! I'm a beginner with this webpage so, I don't know if I'm sending my question to the correct site. Anyway, I'm working with R and I need to import and export ENVI files, (*.HDR files). A colleague told me that there is a package to import/export envi files but I haven't found that package, so does anyone know something about this? thank you so much :) . Ciaooo

I'm guessing they are geographic data? Gridded, raster data perhaps?
This information might have helped... Remember there are 36^3 = 46656
possible alpha-numeric three-character file endings and I'm not sure I
know all of them. Lucky for you this one rang a bell...

So, you probably want the rgdal package. If you've not got it
already, then do this in R:

install.packages("rgdal")

when that's done, you need to load it:

library(rgdal)

and then try and read your file:

map = readGDAL("file.hdr")

and then try:

summary(map)
image(map)

That's a start.

Barry

Reply all
Reply to author
Forward
0 new messages