tabEpiPrev: Epidemiologic Prevalence Table (data frame)

Description Usage Arguments Value Author(s) See Also

Description

Draw an prevalence table with raw data combining with summarized data, in addition with table controlling parameters.

Usage

1
2
3
4
5
tabEpiPrev(data, imput = NULL, rowvar, colvar, riskvar, neg = "0",
  margins = NULL, lang = c("cn", "en"), cols = c("npos", "ntotal",
  "percent"), pct.digits = 0, colvar.together = FALSE,
  empty.cols = FALSE, na.string = .pkgPara()$na.string,
  sort = list(col = 1, desc = FALSE), col.levels = NULL, ...)

Arguments

data

Raw dataset

imput

Summarized data set

rowvar

The variable used as rows

colvar

The variable used as columns

riskvar

The risk variable

neg

Define which value represents negative. Default is 0.

margins

Refer to margins argument in reshape2::dcast

lang

language, "cn" or "en".

cols

A vector. Which elements are to be included. Default is c("npos", "ntotal", "percent"): number of positives, number of total, percent.

pct.digits

Number of digits shown in percentages. If pct.digits==NULL, then the function does not coerce prevalence rates to percents.

colvar.together

Logical.

empty.cols

Logical. If TRUE, empty columns will be added in the table to separate columns sectors.

na.string

A named vector c(cn=..., en=...). How to present NAs when lang is 'cn' or 'en'. Default .pkgPara()$na.string.

sort

Sorting standard. If sort=list(col=1, desc=FALSE), then the function sorts the data ascendingly by Col1. If sort=list(col=3, desc=TRUE), the function sorts the data descendingly by Col3. You can also directly assign a vector, e.g. list(col=1, val=1:4)

col.levels

A vector re-defining the factor level of the variable to be put as the column. Default null.

...

Value

A data frame restructured based on you requirements.

Author(s)

Yiying Wang, wangy@aetna.com

See Also

dcast


madlogos/aseshms documentation built on May 21, 2019, 11:03 a.m.