[R] climate data, Netcdf

Roy Mendelssohn roy.mendelssohn at noaa.gov
Thu Mar 15 13:56:09 CET 2012


Hi Amen:


On Mar 15, 2012, at 2:19 AM, Amen wrote:

> I am a PhD student working on global scale. I am working at INRA in France.I
> am new to R
> 
> I downloaded a netcdf file           cruncep_tair_2010.nc.gz   from
> http://dods.extra.cea.fr/data/p529viov/cruncep/t2m/
> 
> in this file, temperature was measured every 6 hours for 2010, I want to
> convert to daily and then calculate the max ,min ,average daily temperature
> I will appreciate it very much if you kindly help me. 
> 
> How can I see the data using R, just to look at the table and then
> manipulate it
> 

First, install the package "ncdf4". How you do that will depend on the operating system you are using.  On Mac OS and Linux, the normal package manager will work, for Windows it is available from the developers site.

Second, assuming tat you have unzipped the file, do the following  commands to get yourself started:

library(ncdf4)
cruncepFile<-nc_open(' cruncep_tair_2010.nc')
cruncepFile
?ncdf4

Since you want to use R, it would be worth your while at that point to read through the R documentation to learn to do basic manipulations of data that is in your workspace.

HTH,

-Roy M.


**********************
"The contents of this message do not reflect any position of the U.S. Government or NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
1352 Lighthouse Avenue
Pacific Grove, CA 93950-2097

e-mail: Roy.Mendelssohn at noaa.gov (Note new e-mail address)
voice: (831)-648-9029
fax: (831)-648-8440
www: http://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected" 
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.



More information about the R-help mailing list