Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

cubeMeasureType

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)

crunch

Crunch.io Data Tools

v1.28.0
LGPL (>= 3)
Authors
Greg Freedman Ellis [aut, cre], Jonathan Keane [aut], Mike Malecki [aut], Neal Richardson [aut], Gordon Shotwell [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.