export_csv: Export a 'predx' data frame as a 'predx'-formatted CSV file

Description Usage Arguments Value Examples

View source: R/export_csv.R

Description

Export a predx data frame as a predx-formatted CSV file

Usage

1
export_csv(x, filename = NULL, overwrite = F)

Arguments

x

A predx data frame.

filename

Path or file. If NA, data.frame is returned.

overwrite

Overwrite the file if it already exists? Default is FALSE.

Value

Silently saves a predx-formatted CSV if filename is specified. Otherwise returns a flat data frame in the format of the predx csv (i.e. without embedded predx objects).

Examples

1
2
3
4
5
6
7
8
predx_demo <- as.predx_df(list(
 location = c('Mercury', 'Venus', 'Earth'),
 target = 'habitability',
 predx = list(Binary(1e-4), Binary(1e-4), Binary(1))
))
csv_tempfile <- tempfile()
export_csv(predx_demo, csv_tempfile)
import_csv(csv_tempfile)

cdcepi/predx documentation built on Dec. 29, 2019, 4:58 p.m.