filter {crunch}R Documentation

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. There are also helpers to get and set the components of the analysis such as filter(), weight(), transforms(), displaySettings() and vizSpecs(). You can also get the CrunchCube from an analysis using cube().

Usage

filter(x, ...)

filter(x) <- value

## S4 replacement method for signature 'CrunchDeck,ANY'
weight(x) <- value

## S4 replacement method for signature 'CrunchDeck'
filter(x) <- value

## S4 replacement method for signature 'CrunchDeck,ANY'
filters(x) <- value

## S4 method for signature 'CrunchAnalysisSlide'
transforms(x)

## S4 method for signature 'AnalysisCatalog'
transforms(x)

## S4 method for signature 'Analysis'
transforms(x)

## S4 replacement method for signature 'CrunchAnalysisSlide,ANY'
transforms(x) <- value

## S4 replacement method for signature 'AnalysisCatalog,ANY'
transforms(x) <- value

## S4 replacement method for signature 'Analysis,ANY'
transforms(x) <- value

analyses(x)

analysis(x)

analysis(x) <- value

query(x) <- value

cube(x)

cubes(x)

displaySettings(x)

displaySettings(x) <- value

vizSpecs(x)

vizSpecs(x) <- value

## S4 method for signature 'CrunchSlide'
type(x)

## S4 method for signature 'CrunchAnalysisSlide'
analyses(x)

## S4 method for signature 'CrunchAnalysisSlide'
analysis(x)

## S4 replacement method for signature 'CrunchAnalysisSlide,formula'
analysis(x) <- value

## S4 replacement method for signature 'CrunchAnalysisSlide,Analysis'
analysis(x) <- value

## S4 replacement method for signature 'CrunchAnalysisSlide,list'
analysis(x) <- value

## S4 method for signature 'CrunchAnalysisSlide'
filter(x, ...)

## S4 method for signature 'CrunchAnalysisSlide'
filters(x)

## S4 replacement method for signature 'CrunchAnalysisSlide,ANY'
filters(x) <- value

## S4 replacement method for signature 'CrunchAnalysisSlide,ANY'
query(x) <- value

## S4 method for signature 'CrunchAnalysisSlide'
cubes(x)

## S4 method for signature 'CrunchAnalysisSlide'
cube(x)

## S4 method for signature 'CrunchAnalysisSlide'
displaySettings(x)

## S4 replacement method for signature 'CrunchAnalysisSlide,ANY'
displaySettings(x) <- value

## S4 method for signature 'CrunchAnalysisSlide'
vizSpecs(x)

## S4 replacement method for signature 'CrunchAnalysisSlide,ANY'
vizSpecs(x) <- value

## S4 method for signature 'AnalysisCatalog'
cubes(x)

## S4 method for signature 'AnalysisCatalog'
displaySettings(x)

## S4 replacement method for signature 'AnalysisCatalog,list'
displaySettings(x) <- value

## S4 method for signature 'AnalysisCatalog'
vizSpecs(x)

## S4 replacement method for signature 'AnalysisCatalog,list'
vizSpecs(x) <- value

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

formulaToSlideQuery(query, dataset)

## S4 method for signature 'Analysis'
cube(x)

## S4 method for signature 'Analysis'
displaySettings(x)

## S4 replacement method for signature 'Analysis,ANY'
displaySettings(x) <- value

## S4 method for signature 'Analysis'
vizSpecs(x)

## S4 replacement method for signature 'Analysis,ANY'
vizSpecs(x) <- value

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

## S4 method for signature 'Analysis'
filters(x)

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

## S4 replacement method for signature 'CrunchAnalysisSlide'
filter(x) <- value

## S4 replacement method for signature 'Analysis'
filter(x) <- value

## S4 replacement method for signature 'Analysis,CrunchLogicalExpr'
filters(x) <- value

## S4 replacement method for signature 'Analysis,CrunchFilter'
filters(x) <- value

## S4 replacement method for signature 'Analysis,'NULL''
filters(x) <- value

## S4 replacement method for signature 'Analysis,list'
filters(x) <- value

slideQueryEnv(weight, filter)

## S4 method for signature 'CrunchDeck'
cubes(x)

## S4 method for signature 'CrunchAnalysisSlide'
weight(x)

## S4 replacement method for signature 'CrunchAnalysisSlide,ANY'
weight(x) <- value

## S4 method for signature 'Analysis'
weight(x)

Arguments

x

a CrunchSlide, AnalysisCatalog, or Analysis

...

ignored

value

for the setter, an object to set it

query

For formulaToSlideQuery(), a formula that specifies the query, as in newSlide(). See Details of crtabs() for more information.

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.

Details

For more complex objects like displaySettings(), vizSpecs() and transforms(), the API documentation provides more details.

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

## Not run: 
# Examples of setting analysis details (in general these setters work on
# the slide, analysis catalog and analysis, but for brevity the examples only
# show on the slide)

# Change the filter
filters(slide) <- NULL # to remove a filter
filters(slide) <- filters(ds)[["My filter"]]
filters(slide) <- list( # Can set multiple filter
    filters(ds)[["My filter"]],
    ds$age_grp == "18-35"
)
filters(deck) <- filters(ds)[["My filter"]] # Can set the same filter on a whole deck too

# Change the weight
weight(slide) <- NULL # to remove
weight(slide) <- ds$weight
weight(deck) <- ds$weight # Can set the same weight on a whole deck too

# Change the transforms
transforms(slide) <- list(rows_dimension = makeDimTransform(hide = "Neutral"))

# Change the displaySettings
displaySettings(slide) <- list(vizType = "groupedBarPlot")

# Change the vizSpecs
# viz_specs can get quite long, see
# https://crunch.io/api/reference/#post-/datasets/-dataset_id-/decks/-deck_id-/slides/
vizSpecs(slide) <- viz_specs

# Change the query
#' query(slide) <- ~ cyl + wt

## End(Not run)

[Package crunch version 1.30.4 Index]