Cleans and organizes output to account for NAs and remove empty rows. Wrapper around shiny::brushedPoints
.
Examples
brush <- list(
mapping = list(
x = "AGE",
y = "BMRKR1"
),
xmin = 30, xmax = 40,
ymin = 0.7, ymax = 10,
direction = "xy"
)
data <- data.frame(
STUDYID = letters[1:20],
USUBJID = LETTERS[1:20],
AGE = sample(25:40, size = 20, replace = TRUE),
BMRKR1 = runif(20, min = 0, max = 12)
)
nrow(clean_brushedPoints(data, brush))
#> [1] 12
data$AGE[1:10] <- NA
nrow(clean_brushedPoints(data, brush))
#> [1] 5