I am working with netcdf files, and there are some analysis that I've been doing with CDO and then, with R. I would like to know if there would be possible to "call" the CDO directly from R, in the same script. I am not sure how (I have been trying with System() to invoke the commands..but I don't get it). Anyone has an idea about that?? Would it be possible??
Many thanks in advance
Yes, using the system() function you can use bash (in Linux) along R normal routines
For example, a simple code to convert a GRIB2 file to NetCDF
file_grb2 = "001.grb2"
file_ncdf ="001.nc"
system(paste("cd ~/DATA/prate; cdo -f nc copy ",file_grb2,file_ncdf,sep=(" ")))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With