我是R.的新手。我想从https://archive.ics.uci.edu/ml/machine-learning-databases/heart-disease/processed.hungarian.data导入数据集。我能怎么做? 这些是我的尝试
# first attempt
x <- read.table("https://archive.ics.uci.edu/ml/machine-learning-databases/heart-disease/processed.hungarian.data")
Error in file(file, "r") : unable to open connection
In addition: Warning message:
In file(file, "r") : unsupported URL scheme
# second attempt
x <- read.table("C:/Users/Thanushiya/Desktop/processed.hungarian.data.txt", header=TRUE, sep=",", row.names="id")
Error in data[[rowvar]] : attempt to select less than one element
答案 0 :(得分:0)
在数据框中读取它(添加sep = ","
)
df <- read.table("https://archive.ics.uci.edu/ml/machine-learning-databases/heart-disease/processed.hungarian.data",sep = ",")