df2disk: Save a data.frame as both Rdata and CSV

Description Usage Arguments Details Examples

View source: R/helper_fun.R

Description

df2disk saves to disk a given data.frame as both Rdata and CSV with a given name and optional name postfix to a given location.

Usage

1
df2disk(df, dirpath, fname, postfix = "", row_names = FALSE)

Arguments

df

A data.frame

dirpath

The destination path for written files, will be created if necessary

fname

The file name

postfix

An optional name postfix

row_names

Whether to include row names inthe csv file

Details

df2disk is used by the collate_ functions when the operator chooses to save2disk.

Examples

1
2
3
4
my.df <- data.frame(1, 1:10, sample(LETTERS[1:3], 10, replace = TRUE))
my.folder <- file.path(tempdir(check=TRUE), 'test')
df2disk(df=my.df, dirpath=tempdir(check=TRUE), fname='testname')
df2disk(df=my.df, dirpath=my.folder, fname='testname', postfix='_testpostfix')

vortexR documentation built on April 14, 2020, 7:23 p.m.