stateSpec: Set State Parameters

Description Usage Arguments Details Examples

Description

Set State Parameters

Usage

1
2

Arguments

name

the name of the display

group

the group of the display

labels

a vector of names of cognostics to be shown as labels underneath each panel. If not specified, the default is to show labels for any of the splitting variables that created the partition of the data being plotted.

layout

a list with optional elements nrow, ncol, and arrange. nrow and ncol specify the arrangement of the panels into rows and columns (nrow = 1 and ncol = 1 are defaults), and arrange can be either "row" or "col" and specified whether to sort the panels by row or by column ("row" is default)

sort

a named list where each name corresponds to a cognostic name and the value is either "asc" or "desc" for sorting in ascending or descending order. The order in which sorting is applied to each variable is according to the order of the variables specified.

filter

a named list where each name corresponds to a cognostic name and the value is a specification of either "regex" or "select" for categorical variables, or a range, "from" and "to", for quantitative variables. For a "regex", a simple regular expression string is specified, and the filter finds all matches for the regular expression against the variable. For "select" a vector of strings is specified, and all exact matches are returned. For the range filter, all values of the specified variable within the range "from" and "to" are returned. If either "from" or "to" are omitted, they are treated as -Inf and Inf respectively.

Details

Trelliscope allows you to specify either a default state in makeDisplay or specify the state of the display when you call view.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
state <- stateSpec(
  name = "my_display",
  sort = list(state = "desc", county = "asc"),
  filter = list(
    county = list(regex = "Ben"),
    state = list(select = c("OR", "WA")),
    meanList = list(from = 50, to = 150)
  ),
  layout = list(nrow = 2, ncol = 4),
  labels = c("county", "state")
)

state <- validateState(state, checkDisplay = FALSE)

makeStateHash(state)

tesseradata/trelliscope documentation built on May 31, 2019, 8:58 a.m.