as.csv: Read or Write CSV Using Selected Conventions

View source: R/csv.R

as.csvR Documentation

Read or Write CSV Using Selected Conventions

Description

Reads or writes CSV files in a conventional way. Generic, with methods for character and data.frame. A length-one character argument is treated as a filepath and tries to return a data.frame. A data.frame argument is written to the specified filepath. Typically, quote and row.names are FALSE and na is ".". When reading, white space and empty strings are treated as NA, and strip.white is TRUE. When writing, values with commas or double-quotes are double-quoted (and embedded double-quotes are doubled).

Usage

as.csv(x, ...)

Arguments

x

object

...

passed arguments

See Also

as.csv.character, as.csv.data.frame

Other as.csv: as.csv.character(), as.csv.data.frame()

Examples

data <- head(Theoph)
filepath <- file.path(tempdir(),'theoph.csv')
as.csv(data,filepath)
as.csv(filepath)

bergsmat/csv documentation built on July 9, 2022, 11:51 a.m.