get_data {radiant.data}R Documentation

Select variables and filter data

Description

Select variables and filter data

Usage

get_data(
  dataset,
  vars = "",
  filt = "",
  arr = "",
  rows = NULL,
  data_view_rows = NULL,
  na.rm = TRUE,
  rev = FALSE,
  envir = c()
)

Arguments

dataset

Dataset or name of the data.frame

vars

Variables to extract from the data.frame

filt

Filter to apply to the specified dataset

arr

Expression to use to arrange (sort) the specified dataset

rows

Select rows in the specified dataset

data_view_rows

Vector of rows to select. Only used by Data > View in Radiant. Users should use "rows" instead

na.rm

Remove rows with missing values (default is TRUE)

rev

Reverse filter and row selection (i.e., get the remainder)

envir

Environment to extract data from

Details

Function is used in radiant to select variables and filter data based on user input in string form

Value

Data.frame with specified columns and rows

Examples

get_data(mtcars, vars = "cyl:vs", filt = "mpg > 25")
get_data(mtcars, vars = c("mpg", "cyl"), rows = 1:10)
get_data(mtcars, vars = c("mpg", "cyl"), arr = "desc(mpg)", rows = "1:5")

[Package radiant.data version 1.6.6 Index]