[R] Extract data from .nc file

Rasmus Liland jr@| @end|ng |rom po@teo@no
Wed Mar 10 02:46:31 CET 2021


Dear Shailendra and Roy,

Yes, the info ncvar_get retrieves is of 
different lengths.  soi_final does not 
have a time variable for the x axis, and 
tt is a integer vector 
int [1:2001(1d)] 0 365 730 1095 1460 1825 2190 2555 2920 3285 ...

The file is a HDF5 file:

	rasmus using twosixty ~ % file posterior_climate_indices_MCruns_ensemble_full_LMRv2.1.nc
	posterior_climate_indices_MCruns_ensemble_full_LMRv2.1.nc: Hierarchical Data Format (version 5) data

I have read the HDF5 files dsk 
https://github.com/GATB/dsk creates 
before using hdf5r.  It's more 
detailed for digging around in there:

	fname <- "posterior_climate_indices_MCruns_ensemble_full_LMRv2.1.nc"
	file <- hdf5r::h5file(fname, mode = "a")
	hdf5r::list.datasets(file)
	str(file)
	names(file)
	file[["lon_npac"]][["key_info"]][["space"]]
	names(file[["lon_npac"]][["key_info"]])
	file$close_all()

But, I think you perhaps don't want more 
level of detail ...

Best,
Rasmus

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20210310/74fef9ac/attachment.sig>


More information about the R-help mailing list