y <- read.table("https://afltables.com/afl/stats/biglists/bg2.txt", skip = 1, header = T, sep = ' ')
Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec, : line 3 did not have 30 elements
答案 0 :(得分:2)
你可以试试这个。
y <- read.fwf("https://afltables.com/afl/stats/biglists/bg2.txt", skip = 3, widths=c(6, 9, 30, 2), col.names = c("Rank","Games","Player","Teams" ))