Arun 和 Dason 提供了以下答案:
阿伦推荐:
complete_URL <- "http://quickfacts.census.gov/qfd/states/01/01011.html"
temp_TBL <- readHTMLTable(complete_URL, which=4)
business_number_vector <- as.numeric(as.character(temp_TBL[6,3]))
print(business_number_vector)
见第 3 行,在哪里as.numeric(as.character())
帮了大忙!
达森推荐:
complete_URL <- "http://quickfacts.census.gov/qfd/states/01/01011.html"
temp_TBL <- readHTMLTable(complete_URL, which=4)
business_number_vector <- temp_TBL[6,3]
business_number_vector <- as.numeric(levels(business_number_vector)[business_number_vector])
print(business_number_vector)
请参阅第 4 行,其中as.numeric(levels(business_number_vector)[business_number_vector])
也有很大帮助!