cubeMeasureType {crunch}R Documentation

Get measure type of cube result

Description

Returns a string describing the measure type of the cube result, such as "count", "mean", "sd", etc.

Usage

cubeMeasureType(x, measure = NULL)

## S4 method for signature 'CrunchCube'
cubeMeasureType(x, measure = 1)

Arguments

x

A CrunchCube

measure

Which measure in the cube to check, can index by position with numbers or by name. NULL, the default, will select a "sum" type measure first, "mean" if no sum is available, and will use the cube's names in alphabetic order if there are no "sum" or "mean" measures (or if a tie breaker between two measure types is needed).

Value

A string describing the cube's measure type

Examples

## Not run: 
cube1 <- crtabs(~allpets, ds)
cubeMeasureType(cube1)
#> "count"

cube2 <- crtabs(list(a = n(), b = mean(age)) ~ allpets, ds)
cubeMeasureType(cube2)
#> "count"
cubeMeasureType(cube2, "b")
#> "mean"

## End(Not run)

[Package crunch version 1.30.4 Index]