get_standard_table: Get an individual standard table for AHSQC

Description Usage Arguments Details Examples

View source: R/get_standard_table.R

Description

Retrieves the code for the standard AHSQC table specified and returns it in either a separate file or through a text string.

Usage

1
2
get_standard_table(tbl = NULL, data, print = FALSE,
  overwrite = FALSE, pval = FALSE)

Arguments

tbl

NULL or integer 1-9 to identify which table to return.

data

a data table

print

a boolean. If TRUE, the code for specified table will be returned in a tet string. If FALSE, the code for specified table will be written to a separate .R file in the working directory with tbln.R nomenclature.

overwrite

a boolean. If a .R file already exists for the table specified and set to TRUE, the file will be overwritten with original code.

pval

a boolean. Set to TRUE if pvalues are desired for table.

Details

If overwrite = FALSE and a .R file exists for the specified table, the function will throw an error.

If print = TRUE, the overwrite argument will be ignored.

Examples

1
2
3
4
5
6
# Not run:
# d0 <- ahs_get_data()
# d1 <- d0[["analyticview]]
# get_table(tbl = 1, d1, print = TRUE) ## will print code as text
# get_table(tbl = 9, d1, print = FALSE) ## will write tbl9.R
# get_table(tbl = 9, d1, print = FALSE, overwrite = TRUE) ## will overwrite tbl9.R

thomasgstewart/ahsqc documentation built on Jan. 24, 2021, 11:19 a.m.