【发布时间】:2019-07-28 14:00:05
【问题描述】:
在闪亮的框架内,我正在尝试创建一个交互式表格。如此屏幕截图所示,年龄变量未排序。 我该如何解决这个问题?
我尝试了以下代码来订购年龄组变量,但没有奏效。
workforce_t <- workforce
output$workforce_table_1 <- renderTable ({
#sort the age_group variable
workforce_t$Age_Group <- factor(
workforce_t$Age_Group,
levels = c(
"16+",
"16 to 24",
"25 to 34",
"35 to 44",
"45 to 54",
"55 to 64",
"65+"
),
labels = c(
"16+",
"16 to 24",
"25 to 34",
"35 to 44",
"45 to 54",
"55 to 64",
"65+"
)
)
info <- reactive ({
out <- workforce_t %>%
filter (County %in% input$county_workforce,
#Year %in% input$years,
Indicator %in% input$Indicator_workforce)
return(out)
})
(info())
})
谢谢,
纳德
【问题讨论】: