format_statistics: Format statistics

Description Usage Arguments Details Value Methods (by class)

View source: R/format_statistics.R

Description

The results of function statistics must be formated before printing. format_statistics does this.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
format_statistics(x, ...)

## S3 method for class 'statistics_numeric'
format_statistics(x, format_statistics.statistics_numeric = NULL, ...)

## S3 method for class 'statistics_factor'
format_statistics(x, format_statistics.statistics_factor = NULL, ...)

## S3 method for class 'statistics_count_me'
format_statistics(x, ...)

## Default S3 method:
format_statistics(x, ...)

Arguments

x

An object.

...

Passed from and to other methods.

format_statistics.statistics_numeric

Either NULL or a function. Default is NULL. If a function, then it will replace atable:::format_statistics.statistics_numeric. The function must mimic format_statistics: arguments are x and the ellipsis ... . Result is a non-empty data.frame with 2 columns called 'tag' and 'value'.

format_statistics.statistics_factor

Analog to argument format_statistics.statistics_numeric

Details

This function defines which statistics are printed in the final table and how they are formated.

The format depends on the class x. See section methods.

If you are not pleased with the current format you may alter these functions. But you must keep the original output-format, see section Value. Function check_format_statistics checks if the output of statistics is suitable for further processing.

Value

A non-empty data.frame with 2 columns called 'tag' and 'value'. Column 'tag' has class factor and no duplicates. Column 'value' is a character. See also function check_format_statistics.

Methods (by class)


atable documentation built on Dec. 16, 2020, 1:06 a.m.