1. Learn
  2. /
  3. Courses
  4. /
  5. R 数据导入入门

Connected

Exercise

read_delim

就像 read.table() 是 utils 中的主要函数一样,read_delim() 是 readr 中的主要函数。

read_delim() 至少需要两个必填参数:

  • file:包含数据的文件
  • delim:在数据文件中分隔取值的字符

您将继续使用 potatoes.txt(查看);该文件使用制表符("\t")分隔取值,且其第一行并不包含列名。该文件已在您的工作目录中,您可以直接开始。与之前一样,已提供向量 properties,可用于设置 col_names。

Instructions

100 XP
  • 使用 read_delim() 导入 "potatoes.txt" 中的全部数据;将得到的数据框保存到 potatoes。
  • 打印 potatoes。