У меня есть коды R-markdown, которые раньше нормально работали на моем ноутбуке.Теперь, когда я пытаюсь связать их в файл HTML, я получаю эту ошибку:
Error: Must supply a symbol or a string as argument.
Интересно, что моя коллега говорит, что коды работают на ее настольном компьютере.Она использует окна.
Эта ошибка появляется после следующих строк кодов (см. Также скриншот):
acs <-
structure(list(`County Name` = c("U.S.", "Ohio", "Adams", "Allen",
"Ashland", "Ashtabula"), Year = c(2000, 2000, 2000, 2000, 2000,
2000), Sex = c("Male", "Male", "Male", "Male", "Male", "Male"
), `Age Group` = c("All", "All", "All", "All", "All", "All"),
`6th Grade or Less` = c(0.824, 0.038, 0.061, 0.012, 0.04,
0.031), `7th- 12th (No Diploma)` = c(0.085, 0.275, 0.343,
0.28, 0.283, 0.286), `High School Graduate` = c(0.037, 0.341,
0.347, 0.442, 0.436, 0.44), `Some College` = c(0.054, 0.171,
0.162, 0.149, 0.119, 0.148), `Bachelor's Degree` = c(NA,
0.097, 0.038, 0.067, 0.066, 0.053), `Graduate Degree` = c(NA,
0.077, 0.05, 0.049, 0.056, 0.041), `White Non-Hispanic` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `Black Non-Hispanic` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `Other Races Non-Hispanic in` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), Hispanic = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `Total 60+` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `Median Age for 60+` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `% of Population Age 60 & Older` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `% of Population` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `% of Population Living Alone` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `% of Grand Parents Living with Grand Children` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `% of Population with High School Diploma or Higher Degree` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `% of Population with College Degree` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `Median Income` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `% below 100% of Federal Povery Treshhold income` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `% Medicaid Eligible` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `% employed` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `Living Alone` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `0-100%` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `101-200%` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `201-300%` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `301-400%` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `>400%` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), Married = c(0.529,
0.752, 0.732, 0.774, 0.813, 0.724), `Widowed/Divorced/Separated` = c(0.168,
0.207, 0.22, 0.195, 0.153, 0.223), `Never Married` = c(0.303,
0.041, 0.047, 0.031, 0.034, 0.053), `At or Below Poverty Treshhold` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `Above Four Times Poverty Treshhold` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `Income to poverty_less 1` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `Income to poverty_less 1-1.99` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `Income to poverty_less 2-2.99` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `Income to poverty_less 3-3.99` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), `Income to poverty_less 4+` = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_, NA_real_)), row.names = c(NA,
-6L), class = c("tbl_df", "tbl", "data.frame"))
edu.county<-acs %>%
filter(Sex == "Total", `Age Group`=="All", `County Name`%in% c(county, "Ohio"), Year == max(acs$Year))
edu.county$`County Name`<-factor(edu.county$`County Name`, levels = c("Ohio", county))
edu.county<-edu.county %>%
select(`6th Grade or Less`, `7th- 12th (No Diploma)`, `High School Graduate`,
`Some College`, `Bachelor's Degree`, `Graduate Degree`) %>%
gather(c(`6th Grade or Less`, `7th- 12th (No Diploma)`, `High School Graduate`,
`Some College`, `Bachelor's Degree`, `Graduate Degree`), EduPerc)
County<-rep(c("Ohio", county), 6)
edu.county<-cbind(edu.county, County)