Hello all, I downloaded a .grd file from http://pubs.usgs.gov/of/2005/1413/gisdata/data/NAMrad_U.grd and would like to open it in R. Can anyone please tell me how to open .grd type files in R. I tried to read with raster, ncdf and also rgdal, but couldnt. Thanks a lot for your time. Swagath
reading .grd files
2 messages · Swagath, Roman Luštrik
Have you tried something like this? Loading required package: sp
x <- raster() x
class : RasterLayer dimensions : 180, 360, 64800 (nrow, ncol, ncell) resolution : 1, 1 (x, y) extent : -180, 180, -90, 90 (xmin, xmax, ymin, ymax) coord. ref. : +proj=longlat +datum=WGS84
x[] <- runif(ncell(x)) plot(x) writeRaster(x, "myfile.grd")
class : RasterLayer dimensions : 180, 360, 64800 (nrow, ncol, ncell) resolution : 1, 1 (x, y) extent : -180, 180, -90, 90 (xmin, xmax, ymin, ymax) coord. ref. : +proj=longlat +datum=WGS84 data source : C:\Users\romunov\myfile.grd names : layer values : 3.938144e-05, 0.9999952 (min, max)
y <- raster("myfile.grd")
y
class : RasterLayer dimensions : 180, 360, 64800 (nrow, ncol, ncell) resolution : 1, 1 (x, y) extent : -180, 180, -90, 90 (xmin, xmax, ymin, ymax) coord. ref. : +proj=longlat +datum=WGS84 data source : C:\Users\romunov\myfile.grd names : layer values : 3.938144e-05, 0.9999952 (min, max) Cheers, Roman
On Mon, Apr 29, 2013 at 9:46 AM, Swagath <swagathnavin82 at gmail.com> wrote:
Hello all, I downloaded a .grd file from http://pubs.usgs.gov/of/2005/1413/gisdata/data/NAMrad_U.grd and would like to open it in R. Can anyone please tell me how to open .grd type files in R. I tried to read with raster, ncdf and also rgdal, but couldnt. Thanks a lot for your time. Swagath
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
-- In God we trust, all others bring data.