[R] problem selecting 330 to 30 longitude

Paul Hiemstra p.hiemstra at geo.uu.nl
Mon Nov 23 22:51:09 CET 2009


Hi Nora,

Take a look at using the sp-classes to represent spatial data. Take a 
look at the spatial task view [1] for some pointers on how to read data 
into sp-objects (rgdal package) and at solving your particular problem 
(overlay from the sp-package). Also you could consider reposting your 
question at the r-sig-geo mailing list. This list is specifically for 
geographic data.

cheers and hope this helps,
Paul

[1] http://cran.r-project.org/web/views/Spatial.html

Nora Hanson schreef:
> Hello,
>
> This is probably very simple but I am trying to select a region from the
> OIv2 SST dataset that crosses 0 longitude. The longitude variable is
> arranged from 0 to 360 and I get an error message when trying to go from 330
> to 30 for example. The data are from a NOAA netCDF file.
>
> *temp = open.ncdf("c:/documents and settings/theoni/desktop/sstoi_v2.nc")
> print(temp)
> y1 = get.var.ncdf( temp, "latitude")
> x1 = get.var.ncdf( temp, "longitude")
> t1 = get.var.ncdf( temp, "time")
> z1 = get.var.ncdf( temp, "sst")
> sst = get.var.ncdf( temp, "sst", start=c(330,136,313), count=c(56,44,1))*
>
> Error message I get is:
> *Error in get.var.ncdf(temp, "sst", start = c(330, 136, 313), count = c(56,
> :
>   C function R_nc_get_vara_double returned error*
>
> I couldn't seem to find any info on this in the help archives but am a new
> user so apologies if it has been addressed elsewhere.
>
> Many thanks,
> Nora
>
>
>
>




More information about the R-help mailing list