brushed_ts: Filter data frame based on plot brush

Description Usage Arguments Details Value Examples

View source: R/data.R

Description

This function filters data frame rows to a subset corresponding to observations included in the brushed region of a plot.

Usage

1
brushed_ts(data, x, brush, type = "annual")

Arguments

data

data frame.

x

x coordinates. See details.

brush

brushed coordinates. See details.

type

character, "annual" or "decadal".

Details

This implementation is for brushing restricted to the x-axis and to two types of data frames. The annual type handles continuous x-axis data and expects a data frame with aYear column that is x-variable. The decadal type handles categorical x-axis data and expects a Decade column that is the x-variable. x and brush are commonly reactive values in server.R, storing the observed click and brush coordinates in input, rather than the input objects directly.

Value

a data frame.

Examples

1
#not run

leonawicz/snaputils documentation built on May 20, 2019, 10:21 p.m.