R/AllGenerics.R, R/decks.R, R/dimension-transforms.R, and 1 more
analysis-methods.RdSlides 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().
filter(x, ...)
filter(x) <- value
# S4 method for class 'CrunchDeck,ANY'
weight(x) <- value
# S4 method for class 'CrunchDeck'
filter(x) <- value
# S4 method for class 'CrunchDeck,ANY'
filters(x) <- value
# S4 method for class 'CrunchAnalysisSlide'
transforms(x)
# S4 method for class 'AnalysisCatalog'
transforms(x)
# S4 method for class 'Analysis'
transforms(x)
# S4 method for class 'CrunchAnalysisSlide,ANY'
transforms(x) <- value
# S4 method for class 'AnalysisCatalog,ANY'
transforms(x) <- value
# S4 method for class '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 class 'CrunchSlide'
type(x)
# S4 method for class 'CrunchAnalysisSlide'
analyses(x)
# S4 method for class 'CrunchAnalysisSlide'
analysis(x)
# S4 method for class 'CrunchAnalysisSlide,formula'
analysis(x) <- value
# S4 method for class 'CrunchAnalysisSlide,Analysis'
analysis(x) <- value
# S4 method for class 'CrunchAnalysisSlide,list'
analysis(x) <- value
# S4 method for class 'CrunchAnalysisSlide'
filter(x, ...)
# S4 method for class 'CrunchAnalysisSlide'
filters(x)
# S4 method for class 'CrunchAnalysisSlide,ANY'
filters(x) <- value
# S4 method for class 'CrunchAnalysisSlide,ANY'
query(x) <- value
# S4 method for class 'CrunchAnalysisSlide'
cubes(x)
# S4 method for class 'CrunchAnalysisSlide'
cube(x)
# S4 method for class 'CrunchAnalysisSlide'
displaySettings(x)
# S4 method for class 'CrunchAnalysisSlide,ANY'
displaySettings(x) <- value
# S4 method for class 'CrunchAnalysisSlide'
vizSpecs(x)
# S4 method for class 'CrunchAnalysisSlide,ANY'
vizSpecs(x) <- value
# S4 method for class 'AnalysisCatalog'
cubes(x)
# S4 method for class 'AnalysisCatalog'
displaySettings(x)
# S4 method for class 'AnalysisCatalog,list'
displaySettings(x) <- value
# S4 method for class 'AnalysisCatalog'
vizSpecs(x)
# S4 method for class 'AnalysisCatalog,list'
vizSpecs(x) <- value
# S4 method for class 'Analysis,formula'
query(x) <- value
formulaToSlideQuery(query, dataset)
# S4 method for class 'Analysis'
cube(x)
# S4 method for class 'Analysis'
displaySettings(x)
# S4 method for class 'Analysis,ANY'
displaySettings(x) <- value
# S4 method for class 'Analysis'
vizSpecs(x)
# S4 method for class 'Analysis,ANY'
vizSpecs(x) <- value
# S4 method for class 'Analysis'
filter(x, ...)
# S4 method for class 'Analysis'
filters(x)
# S4 method for class 'ANY'
filter(x, ...)
# S4 method for class 'CrunchAnalysisSlide'
filter(x) <- value
# S4 method for class 'Analysis'
filter(x) <- value
# S4 method for class 'Analysis,CrunchLogicalExpr'
filters(x) <- value
# S4 method for class 'Analysis,CrunchFilter'
filters(x) <- value
# S4 method for class 'Analysis,NULL'
filters(x) <- value
# S4 method for class 'Analysis,list'
filters(x) <- value
slideQueryEnv(weight, filter)
# S4 method for class 'CrunchDeck'
cubes(x)
# S4 method for class 'CrunchAnalysisSlide'
weight(x)
# S4 method for class 'CrunchAnalysisSlide,ANY'
weight(x) <- value
# S4 method for class 'Analysis'
weight(x)a CrunchSlide, AnalysisCatalog, or Analysis
ignored
for the setter, an object to set it
For formulaToSlideQuery(), a formula that specifies the query, as in
newSlide(). See Details of crtabs() for more information.
For formulaToSlideQuery(), a CrunchDataset that the variables in
query refer to.
For slideQueryEnv() a crunch variable to use as a weight or NULL
to indicate no weight should be used.
for slideQueryEnv(), a CrunchFilter or CrunchExpression to filter
the slide.
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.
if (FALSE) { # \dontrun{
# 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
} # }