Bir readAlTable işlevini kullanarak bir veri okuma BYU ders verilerini http://yfacts.byu.edu/Article?id=85. Ayrıca verileri temizlemem ve "year", "lds" ve "nonlds" üç değişkenini de adlandırmam gerekiyor.Veri okumaFrame
library("XML")
download.file("http://yfacts.byu.edu/Article?id=85",
destfile = "tuitiondata.html")
BYUtuition <- readHTMLTable("tuitiondata.html",
header=T, skip.rows=4,
colClasses=c("character","FormattedNumber","FormattedNumber"))
names(BYUtuition)<-c("year","lds","nonlds")
Ve alıyorum şu sonuçlar:
BYUtuition
$`NULL`
V1
1 Tuition History
2 For Full-time Undergraduate Students
3 1960-61
4 ...
58 2015-16
59
60 * A significant portion of the cost of operating the university is paid from the tithes of The Church of Jesus Christ of Latter-day Saints. Therefore, students and families of students who are tithe-paying members of the Church have already made a contribution to the operation of the university. Because others will not have made this contribution, they are charged a higher tuition, a practice similar in principle to that of state universities charging higher tuition to nonresidents.
V2 V3
1 NA NA
2 NA NA
3 NA NA
4 NA NA
...
60 NA NA
> mormons<-mormons[[1]]
Error: object 'mormons' not found
> names(BYUtuition)<-c("year","lds","nonlds")
Error in names(BYUtuition) <- c("year", "lds", "nonlds") :
'names' attribute [3] must be the same length as the vector [1]
biri bana yanlış yapıyorum anlamaya yardımcı olacak ve neye ihtiyacım misiniz
Aşağıdaki kod var yerine yapmak?
Teşekkürler