tableAdd: Add info (total, mean, sd, etc.) to matrix or table

View source: R/tableAdd.R

tableAddR Documentation

Add info (total, mean, sd, etc.) to matrix or table

Description

This functions add values from a certain function to the beggining or end of a table.

Usage

tableAdd(x, side = c(1, 4), FUN = sum, label = "Total", ...)

Arguments

x

data.frame or matrix object. All values must be numeric.

side

Indicates the side (1: bottom, 2: left, 3: top, 4: right) for adding info.

FUN

a function (or name of a function) to be applied. The indicated function must return atomic vectors.

label

What name do you want to use for extra column/row?

...

Extra arguments passed to FUN.

Value

Same class object of x.

Examples

tableAdd(x = mtcars)

LuisLauM/ruisu documentation built on March 26, 2024, 8:23 a.m.