cranvas (version 0.8.5)

selected: Set or query the selected (brushed) observations

Description

The column .brushed controls which observations are being brushed (i.e. those TRUE's are selected).

Usage

selected(data)
selected(data) <- value

Arguments

data
the mutaframe
value
a logical vector of the length nrow(data), or a vector of integers which will be used to create a logical vector with TRUE corresponding to these indicies, or a character vector of row names to brush the corresponding rows

Value

The function selected returns the logical vector corresponding to whether the observations are selected or not

See Also

qdata

Examples

Run this code
df <- qdata(mtcars)

selected(df)

selected(df) <- rep(c(TRUE, FALSE), c(10, 22))  # brush the first 10 obs
selected(df)

selected(df) <- 15L  # brush the 15th row
selected(df)

selected(df) <- "Honda Civic"  # brush by row names

Run the code above in your browser using DataCamp Workspace