mannau / h5

Interface to the HDF5 Library
Other
70 stars 22 forks source link

error creating .h5 from script #59

Closed jianlianggao closed 7 years ago

jianlianggao commented 7 years ago

Hi,

I have two scripts, one is for parameters parsing, the other is actual function reading data and writing into .h5 file using the parsed parameters.

Running in terminal windows, in the function, when the line is executed nmrfile<-h5file(outputFilename) error occurs as


  cannot use object of class 'character' in new():  class 'H5File' does not extend that class
Calls: readBrukerZip_h5 -> h5file -> new -> initialize -> initialize
Execution halted ```

if the function is run in R environment (that is entering ">" mode by starting R beforehand ), no error at all.

Please help with this. Many thanks.
epipping commented 7 years ago

@jianlianggao Are you using Rscript to run your script by any chance? Looks remarkably similar to #52.

jianlianggao commented 7 years ago

@epipping Yes, I am using Rscript to run, similar to the #52 issue. Because I am wrapping up the script to enable call from other functions to write .h5 files. I need it work using Rscript. But because I need to pass parameters by optparse, I get error of could not find function "na.omit" with the "--default-packages=methods"

epipping commented 7 years ago

Well, as ?na.omit will tell you, na.omit lives in the stats package. So adding stats to the (comma-separated) list of default packages should take care of that issue (potentially leaving you with another issue of the same type which you can address in a similar fashion...)

jianlianggao commented 7 years ago

@epipping Great!! thank you very much for the hint. I have sorted my issue.