views:

65

answers:

2

I am using R to work with meteorological data. I proceed in two steps:

1- convert grib to netcdf using the commande line function ncl_convert2nc from ncar command language 2- use package ncdf in R to import the netcdf data.

I still have one problem:

2- For some particular grib files, the convertion with ncar tool does not work. Is there other ways or trick (other than transcription into netcdf) to read grib files in R ?

Problem Answered by Dirk: 1- I would like to do automatic treatment of many files within R. Can I call ncl_convert2nc within R ? (answered by Dirk Eddelbuettel below )

+2  A: 

Regarding question 1, the answer is 'Yes' -- see help(system) and the internal=TRUE option if you want to capture results.

Dirk Eddelbuettel
Thanks, this answer problem 1 perfectly!
robin girard
A: 

rgdal also can do it, but is less flexible and requires more care and detail than ncdf or RNetCDF - and depends of your GDAL/rgdal built including the GRIB driver.

mdsumner