as.csv.data.frame {csv} | R Documentation |
Save a Data Frame as CSV.
Description
Saves a data.frame as CSV, using selected conventions.
Usage
## S3 method for class 'data.frame'
as.csv(x, file, na = ".", quote = FALSE, auto = !quote, row.names = FALSE, ...)
Arguments
x |
data.frame |
file |
passed to |
na |
passed to |
quote |
passed to |
auto |
double-quote column names and row values with embedded commas or double-quotes; the latter are escaped by doubling them |
row.names |
passed to |
... |
passed to |
Value
invisible data.frame (x)
See Also
Other as.csv:
as.csv.character()
,
as.csv()
Examples
x <- data.frame(
check.names = FALSE,
stringsAsFactors = TRUE,
person = 1:3,
`name, suffix` = c("Bill Smith", 'Joseph "Joe" Hancock', "Mary Laguire, DDS")
)
file <- tempfile()
as.csv(x,file)
y <- as.csv(file,as.is=FALSE)
attr(y,'source')
attr(y,'source') <- NULL
x
y
stopifnot(identical(x,y))
[Package csv version 0.6.2 Index]