splitByLevel | R Documentation |
Split by factor level
splitByLevel(x, f, ref = FALSE, ...)
## S4 method for signature 'DFrame'
splitByLevel(x, f, ref = FALSE)
x |
Object. |
f |
|
ref |
|
... |
Additional arguments. |
list
List of data frames split by factors.
Updated 2020-09-14.
split()
dplyr::group_split()
df <- S4Vectors::DataFrame(
"compound" = relevel(
factor(
c(
rep(x = "dmso", each = 3L),
rep(x = c("ts_0001", "ts_0002"), each = 9L)
)
),
ref = "dmso"
),
"concentration" = factor(
c(
rep(x = 0, each = 3L),
rep(x = c(0.1, 1, 10), each = 3L, times = 2L)
)
),
"replicate" = factor(
rep(
seq(from = 1L, to = 3L),
times = 7L
)
)
)
lapply(df, levels)
splitByLevel(df, f = "compound", ref = FALSE)
splitByLevel(df, f = "compound", ref = TRUE)
splitByLevel(df, f = "concentration", ref = FALSE)
splitByLevel(df, f = "concentration", ref = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.