Reading HadUK-Grid (NetCDF) files into R and covert into dataframe

Viewed 13

Data read in from: https://data.ceda.ac.uk/badc/ukmo-hadobs/data/insitu/MOHC/HadOBS/HadUK-Grid/v1.1.0.0/region/tasmin/day/v20220310

Read daily min temp data in

nc <- nc_open("xxxxx")     
print(nc)

*Time variable info printed....*     
    time  Size:22281`    
    axis: T`    
    bounds: time_bounds
    units: hours since 1800-01-01 00:00:00  
    standard_name:time    
    calendar: gregorian 

Convert variables

region <- ncvar_get(nc, "geo_region")    
temp <- ncvar_get(nc, "tasmin")    
time <- nc.get.time.series(f = nc,    
                correct.for.gregorian.julian = TRUE,    
                time.dim.name = "time") 

Issue

What is the best way to get this fie into a usable DF of daily regional temperatures? I am not sure if I have converted the time variable right either as end in November 2021 but should be December.

0 Answers
Related