【发布时间】:2020-12-03 00:04:10
【问题描述】:
ggplot 只显示一条垂直线,当我尝试更改 x 轴选择时,该值不会改变。当我尝试更改 x 轴时,x 轴上唯一的内容是“列”一词,而不是根据所选内容的 df$column 值。
df_variable <- df
df_colnames <- colnames(df)
xaxis_input <- selectInput(
inputId = "xaxis",
label = "Feature of Interest",
choices = df_colnames,
selected = df_colnames['default']
)
ui <- fluidPage(
titlePanel("DF"),
xaxis_input,
plotOutput(
outputId = "df_plot",
)
)
server <- function(input, output) {
output$df_plot <- renderPlot({
plot <- ggplot(data = df) +
geom_point(aes(x = input$xaxis, y = some_other_col))
return(plot)
})
}
【问题讨论】: