[R-sig-Geo] APHRODITE V1101R2 NetCDF

Michael Sumner mdsumner at gmail.com
Wed Jan 6 05:54:09 CET 2016


On Wed, Jan 6, 2016 at 2:40 PM, Iztirab Hussain via R-sig-Geo
<r-sig-geo at r-project.org> wrote:
> Hi everyoneWould any one like to share the script to handle the above mentioned .nc file in rstudio to get the output in text,csv or xlsx.The dimention of this data set are as below180 x 140 elements for APHROSpatial coverage      :  (MA) 60.0E - 150.0E, 15.0S - 55.0N Spatial resolution    :  0.5 degree and 0.25 degree latitude/longitude
>  Temporal coverage     :  January 1, 1951 - December 31, 2007 (57 years)
>  Temporal resolution   :  DailyRegardsShakir


I would start with this:

library(ncdf4)  ## note this is now available on Windows via CRAN
(since Dec 2015)
library(raster)

r <- raster("myfile.nc")

## if that works, try
plot(r)

>From there you can do anything you like, including convert to a text
format - but I wouldn't recommend that!  See the help for ?raster and
come back with questions if you can't get what you need. Please read
the posting guidelines and provide details.

(If raster complains about a non-regular grid it's another story, but
still easy enough to deal with using ncdf4 directly or with raster's
cunning tricks. If you need help there you'll need to provide a link
to an exact file specifically so someone can try. )

Cheers, Mike.





>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo



-- 
Michael Sumner
Software and Database Engineer
Australian Antarctic Division
Hobart, Australia
e-mail: mdsumner at gmail.com



More information about the R-sig-Geo mailing list