Reads a file in table format and creates a data frame from it, with cases corresponding to lines and variables to fields in the file.

read.csv(
  file,
  cache = FALSE,
  na.strings = "",
  stringsAsFactors = FALSE,
  encoding = "UTF-8",
  ...
)

Arguments

file

the name of the file which the data are to be read from. Each row of the table appears as one line of the file. If it does not contain an absolute path, the file name is relative to the current working directory, getwd(). Tilde-expansion is performed where supported. This can be a compressed file.

cache

logical. Memory caching? Default FALSE.

na.strings

a character vector of strings which are to be interpreted as NA values. Blank fields are also considered to be missing values in logical, integer, numeric and complex fields. Note that the test happens after white space is stripped from the input, so na.strings values may need their own white space stripped in advance.

stringsAsFactors

logical: should character vectors be converted to factors?

encoding

encoding to be assumed for input strings. It is used to mark character strings as known to be in Latin-1 or UTF-8: it is not used to re-encode the input, but allows R to handle encoded strings in their native encoding.

...

arguments passed to read.csv

Value

return value of read.csv