R语言学习笔记之excel文件读取
在win32位的系统下,RODBC包内的函数是可以直接运行的,但在win64位的系统则不支持!
1.读取外部文件read.table()---csv,txt,excel
最基本函数是read.table(),先介绍read.table(),然后再介绍专门用来读csv的read.csv().
Description
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.
读取一个表格形式的文件,并创建一个相应的数据框,同时可以保留相应的变量和观测.
Usage
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)
但常用的就只有几个参数,重写如下:
2.读取外部文件read.csv()---csv
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。