Skip to contents

The function collects spectral data from a sample in a UNIFI Analysis. First, asynchronous queries are performed for each sample. Then, the data is deserialized by the deserialize_data function. The S3 object containing the spectral data is adapted into a dataframe by the outputlist_to_df function. Finally, the data is saved on disk to the Parquet or HDF5 format with the save_one_sample_data function.

Usage

convert_one_sample_data(
  sample_id,
  connection_params = NULL,
  format = "parquet",
  path = NULL,
  overwrite = T,
  num_spectras = NULL
)

Arguments

sample_id

The id of the sample to be collected

connection_params

OPTIONAL: Connection parameters object created by the create_connection_params function. If not provided, the get_connection_params will look for such object in the global environment

format

The format chosen for the exported file (Parquet or HDF5)

path

OPTIONAL The destination path for the exported file

overwrite

OPTIONAL overwrite the sample if already present on disk

num_spectras

OPTIONAL Number of spectras to be downloaded (OPTIONAL, only if whole sample data not needed, e.g. for testing purposes)

Value

Datatables of the sample's spectral data and metadata are saved in Parquet or HDF5 format in the analysis name folder.

See also

collect_one_sample_data for only collecting data by dowloading from the API into the R environment, and save_one_sample_data to save collected data from the R environment to Parquet or HDF5 files.