ir_as_ir | R Documentation |
ir
ir_as_ir
ir the generic to convert an object to an object of class
ir
.
ir_as_ir(x, ...) ## S3 method for class 'ir' ir_as_ir(x, ...) ## S3 method for class 'data.frame' ir_as_ir(x, ...)
x |
An object. |
... |
Further arguments passed to individual methods.
|
An object of class ir
.
# conversion from an ir object ir::ir_sample_data %>% ir_as_ir() # conversion from a data frame x_ir <- ir::ir_sample_data x_df <- x_ir %>% ir_drop_spectra() %>% dplyr::mutate( spectra = x_ir$spectra ) %>% ir_as_ir() # check that ir_as_ir preserves the input class ir_sample_data %>% structure(class = setdiff(class(.), "ir")) %>% dplyr::group_by(sample_type) %>% ir_as_ir()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.