read.table(file, header = FALSE, sep = "", quote = "\"'",
dec = ".", numerals = c("allow.loss", "warn.loss", "no.loss"),
row.names, col.names, as.is = !stringsAsFactors,
na.strings = "NA", colClasses = NA, nrows = -1,
skip = 0, check.names = TRUE, fill = !blank.lines.skip,
strip.white = FALSE, blank.lines.skip = TRUE,
comment.char = "#",
allowEscapes = FALSE, flush = FALSE,
stringsAsFactors = default.stringsAsFactors(),
fileEncoding = "", encoding = "unknown", text, skipNul = FALSE)
file 文件名,在windows系统下可为“dir\\example.txt”,在linux系统下为“dir/example.txt”
header |
|
sep | 分隔符,默认sep = ""(空格) |
quote | quote只对被当做character的列有效 |
dec | the character used in the file for decimal points. |
numerals | string indicating how to convert numbers whose conversion to double precision would lose accuracy |
row.names | 行名的向量 |
col.names | 列名的向量 |
as.is | the default behavior of Note: to suppress all conversions including those of numeric columns, set Note that |
na.strings | a character vector of strings which are to be interpreted as |
colClasses | 表示读出的列的类型("character"、"numeric"、"Date"等) |
nrows | 正整数,表示读入的最大行数 |
skip | integer: the number of lines of the data file to skip before beginning to read data. |
check.names | logical. If |
fill | logical. If |
strip.white | logical. Used only when |
blank.lines.skip | logical: if |
comment.char | character: a character vector of length one containing a single character or an empty string. Use |
allowEscapes | logical. Should C-style escapes such as \n be processed or read verbatim (the default)? Note that if not within quotes these could be interpreted as a delimiter (but not as a comment character). For more details see |
flush | logical: if |
stringsAsFactors | logical: should character vectors be converted to factors? Note that this is overridden by |
fileEncoding | character string: if non-empty declares the encoding used on a file (not a connection) so the character data can be re-encoded. See the ‘Encoding’ section of the help for |
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 (see |
text | character string: if |
skipNul | logical: should nuls be skipped? |