开始使用免费开始使用

使用 read.table 读取多变量数据

从文件或外部 URL 读取多变量数据通常可以使用 read.table()read.csv(),具体取决于数据源的类型。本练习中,您将从 UCI 机器学习网站读取 wine 数据集。关于该数据集的完整说明见此处:here

有关在 R 中读取数据的更多细节,您可以参考课程 Introduction to Importing Data in RIntermediate Importing Data in R。完成本练习后,wine 数据集会为您预加载。

本练习是课程的一部分

R 中的多元概率分布

查看课程

练习说明

交互式实操练习

通过完成这段示例代码来试试这个练习。

# Read in the wine dataset
wine <- read.table("___", sep = ",")

# Print the first four entries
head(___)

# Find the dimensions of the data
dim(___)

# Check the names of the wine dataset 
___
编辑并运行代码