0

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.

Phil
  • 7,287
  • 3
  • 36
  • 66
Megang
  • 1
  • The tidync package is specifically designed for converting netcdf to dataframe. I recommend checking it out – Robert Wilson Sep 14 '22 at 18:43
  • Unfortunately, one cannot access the dataset without registration. However, you should be able to solve this using `{terra}` via `rast("your_file.nc") |> as.data.frame()`. – dimfalk Oct 17 '22 at 13:15

0 Answers0