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

View source: R/helper_fun.R

df2diskR Documentation

Save a data.frame as both Rdata and CSV

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

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

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')

carlopacioni/vortexR documentation built on May 6, 2022, 12:07 p.m.