Learn R Programming

moonBook (version 0.3.1)

compress: Compress an object of class mytable or cbind.mytable

Description

Compress an object of class mytable or cbind.mytable

Usage

compress(x, no = 2, add.label = TRUE)

# S3 method for mytable compress(x, no = 2, add.label = TRUE)

# S3 method for cbind.mytable compress(x, no = 2, add.label = TRUE)

# S3 method for data.frame compress(x, no = 2, add.label = TRUE)

Arguments

x

An object of class mytable or cbind.mytable

no

Representative group of two groups

add.label

Logical. Whether or not add representative group name

Methods (by class)

  • mytable: S3 method for class mytable

  • cbind.mytable: S3 method for class cbind.mytable

  • data.frame: S3 method for class data.frame

Examples

Run this code
# NOT RUN {
require(stringr)
require(magrittr)
mytable(acs) %>% compress
mytable(Dx~.,data=acs) %>% compress
# }
# NOT RUN {
require(ztable)
mytable(Dx~.,data=acs) %>% compress %>% ztable
mytable(Dx+sex~.,data=acs) %>% compress
# }

Run the code above in your browser using DataLab