Skip to contents

Clean up left-behind wrappers used to communicate with Java code using 'rJava'.

Usage

rm_jwrapper(x, verbose = getOption("photobiology.verbose", default = FALSE))

Arguments

x

generic_spct or generic_mspct object with attribute instr.desc set.

verbose

logical If TRUE, issue message when no action is needed, i.e., the spectral object does not contain a Java wrapper.

Value

a copy of x possibly with field "w" removed, if present, from the embedded instr.desc attribute of spectral objects.

Details

Field w contains a wrapper on a Java object used to communicate with the OmniDriver driver during data acquisition. Once the current connection between R and a spectrometer ends, these wrappers are invalidated, becoming useless. However, if present they create a dependency on 'rJava', possibly triggering errors. In recent versions of 'ooacquire' this wrapper is removed immediately after acquisition. However, the instrument descriptor of spectral objects created with versions of 'ooacquire' from some years ago can contain a member storing the useless Java wrapper. This function removes this field if present.

Method getInstrDesc() removes member field w from the returned value but does not modify its argument, it returns the modified object.

See also

Use function files_rm_jwrapper() to apply function rm_jwrapper() to objects stored in .rda files,

Other Functions and methods related to instrument descriptors.: files_rm_jwrapper(), files_s_irrad_update(), instr_defaults(), update_bad_pixs()