crunch (version 1.27.7)

filter: Get and set slide analyses

Description

Slides are composed of analyses, which are effectively CrunchCubes with some additional metadata. You can get and set a slide's Analysis Catalog with the analyses method, and access an individual analysis with analysis.

Usage

filter(x, ...)

filter(x) <- value

# S4 method for CrunchDeck,ANY filter(x) <- value

analyses(x)

analysis(x)

analysis(x) <- value

query(x) <- value

cube(x)

cubes(x)

# S4 method for CrunchSlide analyses(x)

# S4 method for CrunchSlide analysis(x)

# S4 method for CrunchSlide,formula analysis(x) <- value

# S4 method for CrunchSlide,Analysis analysis(x) <- value

# S4 method for CrunchSlide,list analysis(x) <- value

# S4 method for CrunchSlide filter(x, ...)

# S4 method for CrunchSlide,ANY filter(x) <- value

# S4 method for CrunchSlide,ANY query(x) <- value

# S4 method for CrunchSlide cubes(x)

# S4 method for CrunchSlide cube(x)

# S4 method for AnalysisCatalog cubes(x)

# S4 method for Analysis,formula query(x) <- value

formulaToSlideQuery(query, dataset)

# S4 method for Analysis cube(x)

# S4 method for Analysis filter(x, ...)

# S4 method for ANY filter(x, ...)

# S4 method for CrunchSlide,ANY filter(x) <- value

# S4 method for Analysis,CrunchLogicalExpr filter(x) <- value

# S4 method for Analysis,CrunchFilter filter(x) <- value

# S4 method for Analysis,`NULL` filter(x) <- value

slideQueryEnv(weight, filter)

Arguments

x

a CrunchSlide, AnalysisCatalog, or Analysis

...

ignored

value

for the setter, a query

query

For formulaToSlideQuery(), a formula that specifies the query, as in newSlide()

dataset

For formulaToSlideQuery(), a CrunchDataset that the variables in query refer to.

weight

For slideQueryEnv() a crunch variable to use as a weight or NULL to indicate no weight should be used.

filter

for slideQueryEnv(), a CrunchFilter or CrunchExpression to filter the slide.

Value

an AnalysisCatalog, Analysis, Cube, or Filter

Details

You can get the CrunchCube from a slide or analysis with the cube method and from a CrunchDeck with cubes. Analyses can be changed by assigning a formula into the query function.

Advanced users of the API can assign a list to analysis<- to specify settings on the analyses that are not otherwise available in rcrunch. The helpers formulaToSlideQuery() and slideQueryEnv() help you create objects for the query and query_environment.

Examples

Run this code
# NOT RUN {
analysis(slide)
cube(slide)
cubes(deck)
query(slide) <- ~ cyl + wt
filter(slide)
filter(slide) <- NULL # to remove a filter
filter(slide) <- filters(ds)[["My filter"]]
# }

Run the code above in your browser using DataLab