prWriteTable: Write data in an output text file

Description Usage Arguments Examples

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

1
2
3
4
5

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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)

FrancoisGuillem/project documentation built on May 6, 2019, 5:06 p.m.