Skip to contents

This function is used when analyze is invoked

Usage

simple_analysis(x, ...)

# S4 method for numeric
simple_analysis(x, ...)

# S4 method for logical
simple_analysis(x, ...)

# S4 method for factor
simple_analysis(x, ...)

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

Arguments

x

the already split data being tabulated for a particular cell/set of cells

...

passed on directly

Value

an RowsVerticalSection object (or NULL). The details of this object should be considered an internal implementation detail.

Details

This function has the following behavior given particular types of inputs:

numeric

calls mean on x

logical

calls sum on x

factor

calls length on x

in_rows is called on the resulting value(s).

All other classes of input currently lead to an error.

Author

Gabriel Becker and Adrian Waddell

Examples

simple_analysis(1:3)
#> RowsVerticalSection (in_rows) object print method:
#> ----------------------------
#>   row_name formatted_cell indent_mod row_label
#> 1     Mean           2.00          0      Mean
simple_analysis(iris$Species)
#> RowsVerticalSection (in_rows) object print method:
#> ----------------------------
#>     row_name formatted_cell indent_mod  row_label
#> 1     setosa             50          0     setosa
#> 2 versicolor             50          0 versicolor
#> 3  virginica             50          0  virginica
simple_analysis(iris$Species == "setosa")
#> RowsVerticalSection (in_rows) object print method:
#> ----------------------------
#>   row_name formatted_cell indent_mod row_label
#> 1    Count             50          0     Count