Learn R Programming

fifer (version 1.1)

SummarizeVar: Summarize a vector (continuous or factor)

Description

Summarize a continuous or discrete (factor) vector.

Usage

SummarizeVar(x, group = rep(1, length(x)), latex = TRUE,
  decimalFactor = 0, decimalContinuous = 2,
  ContinuousSummaryFunction = SummarizeContinuousDefault,
  FactorSummaryFunction = SummarizeFactorDefault, ...)

Arguments

x
Vector of values.
group
Group identifiers to return summaries by group.
latex
Return LaTeX characters if TRUE (default). For example, the LaTeX code for the percentage symbol should be preceeded by the escape character \.
decimalFactor
The number of decimals to display in percentages for factor variables. This is passed to the decimal in factor.summary.function.
decimalContinuous
The number of decimals to display in percentages for numeric variables. This is passed to the decimal in ContinuousSummaryFunction.
ContinuousSummaryFunction
Function to use to summarize a continuous variable; defaults to SummarizeContinuousDefault. Function must take in the following arguments: x: a vector of values. group: a vector that identifies group. decimal: a numeric value to indicate the decimal places in the formatted output. latex: a logical value that indicates whether the resulting output contains LaTeX code; should default to TRUE. ...: additional arguments.
FactorSummaryFunction
Function to use to summarize a factor variable; defaults to SummarizeFactorDefault. See ContinuousSummaryFunction.
...
Arguments to be passed to ContinuousSummaryFunction and FactorSummaryFunction.

Value

Formatted text in a vector or matrix.

References

This function was borrowed (and modified) from Vinh Nguyen's day2day package.