Search code examples
rdata-structuresnetcdfgrib

Using R to open grib files


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

  1. convert grib to netcdf using the command 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 conversion 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 )


Solution

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