share_spec: Share data with the Open Specy community

View source: R/share_spec.R

share_specR Documentation

Share data with the Open Specy community

Description

This helper function shares spectral data and metadata with the Open Specy community.

Please note that share_spec() only provides basic sharing functionality if used interactively. This means that files are only formatted and saved for sharing but are not send automatically. This only works with hosted instances of Open Specy.

Usage

share_spec(data, ...)

## Default S3 method:
share_spec(data, ...)

## S3 method for class 'data.frame'
share_spec(
  data,
  metadata = c(user_name = "", contact_info = "", organization = "", citation = "",
    spectrum_type = "", spectrum_identity = "", material_form = "", material_phase = "",
    material_producer = "", material_purity = "", material_quality = "", material_color =
    "", material_other = "", cas_number = "", instrument_used = "",
    instrument_accessories = "", instrument_mode = "", spectral_resolution = "",
    laser_light_used = "", number_of_accumulations = "", total_acquisition_time_s = "",
    data_processing_procedure = "", level_of_confidence_in_identification = "", 
    
    other_info = "", license = "CC BY-NC"),
  file = NULL,
  share = "system",
  id = paste(digest(Sys.info()), digest(sessionInfo()), sep = "/"),
  ...
)

Arguments

data

a data frame containing the spectral data; columns should be named "wavenumber" and "intensity".

metadata

a named vector of the metadata to share; see details below.

file

file to share (optional).

share

accepts any local directory to save the spectrum for later sharing via e-mail to wincowger@gmail.com; "system" (default) uses the Open Specy package directory at system.file("extdata", package = "OpenSpecy"); if a correct API token exists, "dropbox" shares the spectrum with the cloud.

id

a unique user and/or session ID; defaults to paste(digest(Sys.info()), digest(sessionInfo()), sep = "/").

...

further arguments passed to the submethods.

Details

The metadata argument may contain a named vector with the following details (* = mandatory):

user_name*: User name, e.g. "Win Cowger"
contact_info: Contact information, e.g. "1-513-673-8956, wincowger@gmail.com"
organization: Affiliation, e.g. "University of California, Riverside"
citation: Data citation, e.g. "Primpke, S., Wirth, M., Lorenz, C., & Gerdts, G. (2018). Reference database design for the automated analysis of microplastic samples based on Fourier transform infrared (FTIR) spectroscopy. Analytical and Bioanalytical Chemistry. doi: 10.1007/s00216-018-1156-x"
spectrum_type*: Raman or FTIR
spectrum_identity*: Material/polymer analyzed, e.g. "Polystyrene"
material_form: Form of the material analyzed, e.g. textile fiber, rubber band, sphere, granule
material_phase: Phase of the material analyzed (liquid, gas, solid)
material_producer: Producer of the material analyzed, e.g. Dow
material_purity: Purity of the material analyzed, e.g. 99.98%
material_quality: Quality of the material analyzed, e.g. consumer product, manufacturer material, analytical standard, environmental sample
material_color: Color of the material analyzed, e.g. blue, #0000ff, (0, 0, 255)
material_other: Other material description, e.g. 5 ┬Ám diameter fibers, 1 mm spherical particles
cas_number: CAS number, e.g. 9003-53-6
instrument_used: Instrument used, e.g. Horiba LabRam
instrument_accessories: Instrument accessories, e.g. Focal Plane Array, CCD
instrument_mode: Instrument modes/settings, e.g. transmission, reflectance
spectral_resolution: Spectral resolution, e.g. 4/cm
laser_light_used: Wavelength of the laser/light used, e.g. 785 nm
number_of_accumulations: Number of accumulations, e.g 5
total_acquisition_time_s: Total acquisition time (s), e.g. 10 s
data_processing_procedure: Data processing procedure, e.g. spikefilter, baseline correction, none
level_of_confidence_in_identification: Level of confidence in identification, e.g. 99%
other_info: Other information
license: The license of the shared spectrum; defaults to "CC BY-NC" (see https://creativecommons.org/licenses/by-nc/4.0/ for details). Any other creative commons license is allowed, for example, CC0 or CC BY

Value

share_spec() returns only messages/warnings.

Author(s)

Zacharias Steinmetz, Win Cowger

See Also

read_text(); digest(); sessionInfo()

Examples

## Not run: 
data("raman_hdpe")
share_spec(raman_hdpe,
           metadata = c(user_name = "Win Cowger",
                        spectrum_type = "FTIR",
                        spectrum_identity = "PE",
                        license = "CC BY-NC"),
           share = tempdir())

## End(Not run)


OpenSpecy documentation built on July 6, 2022, 5:07 p.m.