st_new: Create an st object

View source: R/table-object.R

st_newR Documentation

Create an st object

Description

The st object will collect various configuration settings and pass those to stable() when the object is passed to st_make().

Usage

st_new(x, ...)

## S3 method for class 'data.frame'
st_new(x, ...)

## S3 method for class 'pmtable'
st_new(x, ...)

st_data(x, ...)

Arguments

x

either a data frame or an object of class pmtable; see details.

...

additional arguments which will eventually get passed to the table render function (e.g. stable() or stable_long()).

Details

Methods are included for data.frame and pmtable, an object that comes from one of the data summary functions (e.g. pt_cont_wide(), or pt_cat_long() or pt_demographics()).

If using the data frame method, the user should filter or subset so that the data (x) contains exactly the rows (and columns) to be processed; pmtables will not add or remove rows prior to processing x.

Value

And object with class stobject which can get piped to other functions. The pmtable method returns an object that also has class ptobject.

Examples

ob <- st_new(ptdata())
ob <- st_data(ptdata())

ob <- st_new(pt_data_inventory(pmt_obs))


metrumresearchgroup/pmtables documentation built on Oct. 27, 2024, 5:16 p.m.