clean_brushedPoints: Clean brushed points

View source: R/plot_with_settings.R

clean_brushedPointsR Documentation

Clean brushed points

Description

[Stable]
Cleans and organizes output to account for NAs and remove empty rows. Wrapper around shiny::brushedPoints.

Usage

clean_brushedPoints(data, brush)

Arguments

data

(data.frame)
A data.frame from which to select rows.

brush

(list)
The data from a brush e.g. input$plot_brush.

Value

A data.frame of selected rows.

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))
data$AGE[1:10] <- NA
nrow(clean_brushedPoints(data, brush))


teal.widgets documentation built on April 4, 2025, 2:17 a.m.