R语言文件读取方法|read.table()和read.csv()、read.delim()的区别

除了默认分隔符不同,没有其它区别!

请看官方文档:

read.csv and read.csv2 are identical to read.table except for the
defaults. They are intended for reading ‘comma separated value’ files
(‘.csv’) or (read.csv2) the variant used in countries that use a comma
as decimal point and a semicolon as field separator. Similarly,
read.delim and read.delim2 are for reading delimited files, defaulting
to the TAB character for the delimiter. Notice that header = TRUE and
fill = TRUE in these variants, and that the comment character is
disabled.

翻译:

read.csv和read.csv2与read.table相同,但默认值除外。
它们用于读取“逗号分隔值”文件(’.csv’)或(read.csv2)在使用逗号作为小数点和分号作为字段分隔符的国家/地区中使用的变体。
类似地,read.delim和read.delim2用于读取默认分隔符为TAB的文件。 请注意,这些变体中的header =
TRUE和fill = TRUE,并且注释字符已禁用。

《R语言实战》:

读取Excel文件,推荐先导出成.csv文件再用read.csv导入。如果要直接导入,可以用xlsx包。

注:对于大型数据的读取可以使用readr包和readxl包,速度比read.table()快很多。
  • 8
    点赞
  • 26
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值