我正在尝试制作一张地图,其中选择不同的单选按钮选项会为您提供一张按密度上色的欧盟地图。但是,当我使用input $将单选按钮连接到服务器部分时,它无法正确连接。我在做什么错了?
数据是每个国家在5列中的动物数量。当我将列标题直接写到服务器部分的代码中时,会得到一张按色阶显示相对种群的地图(这是我想要的),但是当我尝试向单选按钮输入$时,它只会显示所有国家/地区我有相同颜色的数据(不根据人口数量区分颜色)。如何修复radiobutton-input $连接?
ui<- fluidPage(
radioButtons(inputId = "type", "Choose an animal",
c("Cat" = "cat_pop",
"Dog" = "dog_pop",
"Chicken" = "chicken_pop",
"Dairy Cow" = "dcow_pop",
"Grey Wolf" = "wolf_pop")),
plotOutput(outputId = "graph")
)
server<- function(input, output) {
output$graph<- renderPlot({
EU_base +
geom_polygon(data = animalmap, aes(fill = input$type)) +
geom_polygon(color = "black", fill = NA) +
theme_bw() +
ditch_the_axes} +
coord_fixed(xlim = c(30, -10), ylim = c(36, 70), ratio = 1.3)
)
}
shinyApp(ui = ui, server = server)
#当我替换aes(fill = cat_pop)时,它可以正常工作,但是无法通过单选按钮进行更改
答案 0 :(得分:0)
https://docs.oracle.com/javase/tutorial/essential/environment/cmdLineArgs.html,但是使用NSImage* image = [NSImage imageNamed:@"imageName"];
image.template = NO;
时要传递带引号的参数。尝试...: error: expected unqualified-id
{ image.template = NO; }
^
input$type