writeToCsv: Write data from an R object to a csv file

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/writeToCsv.r

Description

Use this function to the values of an R variable to a csv file.

Usage

1
2
3
4
  writeToCsv(data, file = deparse(substitute(data)), 
            header, rowheader = TRUE, 
            overwrite = FALSE, na = "", ...)
  

Arguments

data

name of R object to write out

file

file to write to; default is the name of the R object

header

do you want to write out the column header(s)/names(s) too?

rowheader

do you want to write out the row header(s)/name(s) too?

overwrite

If TRUE, file will always be overwritten. If FALSE, file will never be overwritten. If "version", the first version of the filename of the form 'file-xx.csv' that doesn't yet exist will be created, up to a maximum of xx=99.

na

the string to use for missing values in the data

...

arguments to be passed to other methods

Details

Essentially a wrapper for R's write.csv function that standardizes the argument list throughout the excelRio package, does some error checking, and enables a simple "version-ing" for different iterations of the same data variable.

Value

The name with path of the file written.

Author(s)

dmm

See Also

readFromCsv, pasteFromExcel, copyToExcel

Examples

1
2
3
4
loss <- 100 * (1:5)
names(loss) <- LETTERS[1:5]
### NOT RUN
# writeToCsv(loss) # Saves the data in 'dataout.csv'

trinostics/excelRio documentation built on June 18, 2020, 4:41 p.m.