predx
data frame as a predx
-formatted CSV fileexport_csv.Rd
Export a predx
data frame as a predx
-formatted CSV file
export_csv(x, filename = NULL, overwrite = F)
x | A |
---|---|
filename | Path or file. If NA, data.frame is returned. |
overwrite | Overwrite the file if it already exists? Default is FALSE. |
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).
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)#> # A tibble: 3 x 4 #> location target predx_class predx #> <chr> <chr> <chr> <list> #> 1 Mercury habitability Binary <Binary> #> 2 Venus habitability Binary <Binary> #> 3 Earth habitability Binary <Binary>