prWriteTable {tinyProject}R Documentation

Write data in an output text file

Description

These functions are wrappers to write.table, write.csv and write.csv2. They write a matrix or a data.table in a ".txt" or ".csv" file in the output folder. The file created has the same name as the object.

Usage

prWriteTable(name, ..., replace = FALSE)

prWriteCsv(name, ..., replace = FALSE)

prWriteCsv2(name, ..., replace = FALSE)

Arguments

name

Name of the object to write. Quotes are optional. This argument can also specify the subdirectory of folder "output" where to write the file.

...

arguments to write.table

replace

If the file already exists, should it be overwritten ?

Examples

projectPath <- file.path(tempdir(), "test")
prInit(projectPath)

mydata <- data.frame(x = 1:10, y = rnorm(10))

prWriteTable(mydata)
list.files(projectPath, recursive = TRUE, include.dirs = TRUE)

# Write in a subdirectory of "output"
prWriteTable("mydir/mydata")
list.files(projectPath, recursive = TRUE, include.dirs = TRUE)


[Package tinyProject version 0.6.1 Index]