baytrends (version 1.1.0)

saveDF: Save R object to disk

Description

Saves R object to disk using csv and/or Rdata format.

Usage

saveDF(rObj, note = NULL, rData = FALSE, csv = TRUE, attr = FALSE,
  timeStamp = TRUE, folder = "_saveDF")

Arguments

rObj

Name of R object to save.

note

Suffix to include in file name.

rData

Logical field to save rObj as an rData file (FALSE [default]).

csv

Logical field to save rObj as an a csv file (TRUE [default]).

attr

Logical field to save data frame attributes as a text file (FALSE [default]).

timeStamp

Logical field to include date/time stamp in file name (TRUE [default]).

folder

Subdirectory for saving file ('_saveDF' is default)

Value

n/a

Details

Output files are saved with an "rObj_note_YYYY_MM_DD_HHMMSS" naming convetion. By default, files are saved as csv files to a '_saveDF' subdirectory relative to the working directory and include a time stamp in the file name using utils::write.csv. The default folder can be changed with the folder argument. Inclusion of a time stamp in the file name enables saving the same object at multiple steps through an R script, but can be turned off with the timeStamp argument. To also save object as rData file, set rData=TRUE.

Examples

Run this code
# NOT RUN {
df <- data.frame(x=c(1:100))
saveDF(df,'test_note')
# }

Run the code above in your browser using DataCamp Workspace