bsStat: Summary of Basic Statistics

View source: R/bsStat.r

bsStatR Documentation

Summary of Basic Statistics

Description

Calcluate basic statistics of data.

Usage

bsStat(y, two = NULL, digits = c(2, 2), use = 'complete.obs', 
  na.rm = TRUE, ...)

Arguments

y

input data for summary statistics.

two

a logical value of whether to report the correlation and summary statistics separately; if NULL and the number of variables is less than 11, its value will be set to TRUE.

digits

digits for the output data, one for correlation coefficients and the other for mean and others; if a single scalar is supplied, it will be used for both.

use

an argument for correlation coefficient; see cor for detail.

na.rm

an argument for mean, sd, min, and max.

...

additional arguments to be passed.

Details

Two set of summary statistics are generated. One is correlation coefficients and the other is mean, minimum, maximum, standard deviation, and number of observations. When two is unspecified and the number of variables is bigger than ten, the two sets are reported separately; otherwise, it is reported as a single data frame object.

Value

A dataframe or list of the summary statistics.

Author(s)

Changyou Sun (edwinsun258@gmail.com)

Examples

data(daIns)
(sum.daIns <- bsStat(y=daIns, digits=c(3,2)))

erer documentation built on Sept. 26, 2024, 5:06 p.m.