import_csv: Import a 'predx'-formatted CSV file as a 'predx' data frame

Description Usage Arguments Value Examples

View source: R/import_csv.R

Description

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

Usage

1

Arguments

file

A csv file/path *or* a data.frame object. Either should have a predx_class column and whatever columns are needed for the included classes (e.g. point, bin, prob).

colClasses

optional. Can be specified folling read.csv to control column classes.

Value

A predx data frame.

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.