Get selected rows from data and its selection The function leverage `dplyr::filter` to select the rows
Examples
data <- data.frame(
x = seq(0, 9),
y = seq(10, 19),
mdv = c(1, 1, rep(0, 8)),
groups = rep(c("A", "B"), 5)
)
# Select all the rows
getSelectedRows(data, DataSelectionKeys$ALL)
#> [1] TRUE
# Select no row
getSelectedRows(data, DataSelectionKeys$NONE)
#> [1] FALSE
# Select rows from group A
getSelectedData(data, "groups %in% 'A'")
#> x y mdv groups
#> 1 0 10 1 A
#> 2 2 12 0 A
#> 3 4 14 0 A
#> 4 6 16 0 A
#> 5 8 18 0 A
# Get rows of missing dependent variable (mdv)
getSelectedRows(data, "mdv == 0")
#> [1] 3 4 5 6 7 8 9 10