Extract EEM samples

Share:

Description

Extract EEM samples

Usage

1
2
eem_extract(eem, sample, keep = FALSE, ignore_case = FALSE,
  verbose = TRUE)

Arguments

eem

An object of class eemlist.

sample

Either numeric of character vector. See details for more information.

keep

logical. If TRUE, the specified sample will be returned. If FALSE, they will be removed.

ignore_case

Logical, should sample name case should be ignored (TRUE) or not (FALSE). Default is FALSE.

verbose

Logical determining if removed/extraced eems should be printed on screen.

Details

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.

Value

An object of class eemlist.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
folder <- system.file("extdata/cary/scans_day_1", package = "eemR")
eems <- eem_read(folder)

eems

# Remove first and third samples
eem_extract(eems, c(1, 3))

# Remove everything except first and third samples
eem_extract(eems, c(1, 3), keep = TRUE)

# Remove all samples containing "3" in their names.
eem_extract(eems, "3")

# Remove all samples containing either character "s" or character "2" in their names.
eem_extract(eems, c("s", "2"))

# Remove all samples containing "blank" or "nano"
eem_extract(eems, c("blank", "nano"))