Extract EEM samples
eem_extract(eem, sample, keep = FALSE, ignore_case = FALSE, verbose = TRUE)
eem | An object of class |
---|---|
sample | Either numeric of character vector. See |
keep | logical. If TRUE, the specified |
ignore_case | Logical, should sample name case should be ignored (TRUE) or not (FALSE). Default is FALSE. |
verbose | Logical determining if removed/extracted eems should be printed on screen. |
An object of class eemlist
.
sample
argument can be either numeric or character vector. If
it is numeric, samples at specified index will be removed.
If sample
is character, regular expression will be used and all
sample names that have a partial or complete match with the expression will
be removed. See examples
for more details.
folder <- system.file("extdata/cary/scans_day_1", package = "eemR") eems <- eem_read(folder, import_function = "cary") eems#> sample ex_min ex_max em_min em_max is_blank_corrected is_scatter_corrected #> 1 nano 220 450 230 600 FALSE FALSE #> 2 sample1 220 450 230 600 FALSE FALSE #> 3 sample2 220 450 230 600 FALSE FALSE #> 4 sample3 220 450 230 600 FALSE FALSE #> is_ife_corrected is_raman_normalized #> 1 FALSE FALSE #> 2 FALSE FALSE #> 3 FALSE FALSE #> 4 FALSE FALSE#> Removed sample(s): nano sample2#> sample ex_min ex_max em_min em_max is_blank_corrected is_scatter_corrected #> 1 sample1 220 450 230 600 FALSE FALSE #> 2 sample3 220 450 230 600 FALSE FALSE #> is_ife_corrected is_raman_normalized #> 1 FALSE FALSE #> 2 FALSE FALSE#> Extracted sample(s): nano sample2#> sample ex_min ex_max em_min em_max is_blank_corrected is_scatter_corrected #> 1 nano 220 450 230 600 FALSE FALSE #> 2 sample2 220 450 230 600 FALSE FALSE #> is_ife_corrected is_raman_normalized #> 1 FALSE FALSE #> 2 FALSE FALSE# Remove all samples containing "3" in their names. eem_extract(eems, "3")#> Removed sample(s): sample3#> sample ex_min ex_max em_min em_max is_blank_corrected is_scatter_corrected #> 1 nano 220 450 230 600 FALSE FALSE #> 2 sample1 220 450 230 600 FALSE FALSE #> 3 sample2 220 450 230 600 FALSE FALSE #> is_ife_corrected is_raman_normalized #> 1 FALSE FALSE #> 2 FALSE FALSE #> 3 FALSE FALSE# Remove all samples containing either character "s" or character "2" in their names. eem_extract(eems, c("s", "2"))#> Removed sample(s): sample1 sample2 sample3#> sample ex_min ex_max em_min em_max is_blank_corrected is_scatter_corrected #> 1 nano 220 450 230 600 FALSE FALSE #> is_ife_corrected is_raman_normalized #> 1 FALSE FALSE#> Removed sample(s): nano#> sample ex_min ex_max em_min em_max is_blank_corrected is_scatter_corrected #> 1 sample1 220 450 230 600 FALSE FALSE #> 2 sample2 220 450 230 600 FALSE FALSE #> 3 sample3 220 450 230 600 FALSE FALSE #> is_ife_corrected is_raman_normalized #> 1 FALSE FALSE #> 2 FALSE FALSE #> 3 FALSE FALSE