Learn R Programming

SciencesPo (version 1.02.12)

exportData: Writes a delimited text file

Description

Writes a delimited text file, using tab as seperator.

Usage

exportData(data, name, quote = FALSE, row.names = FALSE, sep = "\t", ...)

Arguments

data
the data object to write the csv.
name
the filename to be stored.
quote
If TRUE, any character or factor columns will be surrounded by double quotes. Default is quote=FALSE
row.names
if TRUE, the row names will be write to file. Default is row.names=FALSE.
sep
the field separator string.
...
other uncommon arguments to write.table (ex: fileEncoding)

encoding

UTF-8

Examples

Run this code
df = data.frame(id=1:20, x=rnorm(20, mean=2, sd=.5), y=rnorm(20, mean=5, sd=2))
exportData(df, "MyData")

Run the code above in your browser using DataLab