convert a netcdf time variable to an R date object

前端 未结 3 1264
孤街浪徒
孤街浪徒 2021-01-01 00:55

I have a netcdf file with a timeseries and the time variable has the following typical metadata:

    double time(time) ;
            time:standard_name = \"t         


        
3条回答
  •  南笙
    南笙 (楼主)
    2021-01-01 01:36

    I have just discovered that there is a package called ncdf.tools which has the function:

    convertDateNcdf2R

    which

    converts a time vector from a netCDF file or a vector of Julian days (or seconds, minutes, hours) since a specified origin into a POSIXct R vector.

    which is helpful. More details available here: https://rdrr.io/cran/ncdf.tools/man/convertDateNcdf2R.html

提交回复
热议问题