我的代码是:
theCountry <- c("CAN", "DEU", "ITA","USA","GBR","FRA","JPN")
# These are the ISO3 names of the countries you'd like to plot in red
malDF <- data.frame(country = c("CAN", "DEU", "ITA","USA","GBR","FRA","JPN"),
SixtyFivePlus = c("16.15%", "21.12%", "22.36%", "14.64%", "18.12%", "18.94%", "26.02%"))
# malDF is a data.frame with the ISO3 country names plus a variable to
# merge to the map data
malMap <- joinCountryData2Map(malDF, joinCode = "ISO3",
nameJoinColumn = "country")
# This will join your malDF data.frame to the country map data
mapCountryData(malMap, nameColumnToPlot="SixtyFivePlus", catMethod = "categorical",
missingCountryCol = gray(.8), colourPalette = c("seagreen","seagreen1","seagreen2",
"seagreen3","chartreuse","chartreuse2","chartreuse4"))
identifyCountries(dF = "malDF"
, nameCountryColumn = "malMap"
, nameColumnToPlot = "SixtyFivePlus"
, plotSelected = FALSE
)
它给出了这个错误: identify.default中出错(x = dF2 [[nameX]],y = dF2 [[nameY]],labels = labels,: 零长度标签&#39;指定的
我不知道在x和y中输入什么,因为我还在学习R.有人可以帮助我使地图互动,所以他们给出了向量中提到的值吗?