Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to add data after creating the HDF files #174

Open
suhail017 opened this issue Aug 2, 2021 · 0 comments
Open

Unable to add data after creating the HDF files #174

suhail017 opened this issue Aug 2, 2021 · 0 comments

Comments

@suhail017
Copy link

Hi
I am creating a netcdf file using hdf5r package with the following attributes

> ds
Class: H5File
Filename: /home/suhail/Downloads/cheswx/station_data/homog_ref/prcp_homog_ref_19480101_20171231.nc
Access type: H5F_ACC_RDWR
Attributes: _NCProperties
Listing:
                name    obj_type dataset.dims dataset.type_class
          station_id H5I_DATASET    11 x 1681         H5T_STRING
   string_station_id H5I_DATASET           11          H5T_FLOAT
                time H5I_DATASET          840          H5T_FLOAT
           longitude H5I_DATASET         1681          H5T_FLOAT
           elevation H5I_DATASET         1681          H5T_FLOAT
        station_name H5I_DATASET    32 x 1681         H5T_STRING
            latitude H5I_DATASET         1681          H5T_FLOAT
 string_station_name H5I_DATASET           32          H5T_FLOAT
                prcp H5I_DATASET   1681 x 840          H5T_FLOAT

But whenever i try to add data (obs_adj) to the existing file (ds) , it give me following error:

ds[prcp][] <- obs_adj
Error in `*tmp*`["prcp"] : 
  object of type 'environment' is not subsettable

Also, if i use the following syntax, it gives me another error

ds[['prcp']] <- obs_adj

Error in `[[<-.H5File`(`*tmp*`, "prcp", value = c(157.4, 53.1, 274.5,  : 
  Cannot assign - already exists. Please use the 'link_delete' to delete the object before assigning a new one 

Is there any other way of adding data to a HDF5 file? Your any kind of advice or suggestion will be great. I am using R version 4.0.5 and hdf5r version 1.3.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant