Description Usage Arguments Value Examples
View source: R/is_group_subset.R
Test whether a data.frame is a proper subset of any defined groups within a target data.frame.
1 | is_group_subset(x, target, by, group)
|
x |
Focal data.frame, reflecting a single 'group' of interest |
target |
Target data.frame, containing one or more defined groups |
by |
Character vector giving the column(s) by which |
group |
Name of the column within |
Logical indicating whether x
is a proper subset of any groups within
target
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | target <- data.frame(
g = c("1", "1", "1", "2", "2", "3", "3", "4", "4", "5", "5"),
x1 = c("a", "a", "a", "b", "b", "a", "a", "b", "c", "a", "b"),
x2 = c("a", "a", "a", "b", "b", "a", "a", "b", "c", "a", "b"),
stringsAsFactors = FALSE
)
x1 <- data.frame(
g = c("6", "6"),
x1 = c("a", "a"),
x2 = c("a", "a"),
stringsAsFactors = FALSE
)
is_group_subset(x1, target, group = "g", by = c("x1", "x2"))
x2 <- data.frame(
g = c("7", "7"),
x1 = c("a", "d"),
x2 = c("a", "d"),
stringsAsFactors = FALSE
)
is_group_subset(x2, target, group = "g", by = c("x1", "x2"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.