[R] Import/export ENVI files

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Mon Aug 24 15:28:23 CEST 2009

2009/8/24 Lucas Sevilla García <luckoctober at 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:


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


 and then try and read your file:

 map = readGDAL("file.hdr")

 and then try:


 That's a start.


More information about the R-help mailing list