在我使用RShiny的第一個項目中,我有一個使用金字塔庫(https://cran.r-project.org/web/packages/pyramid/index.html)的問題。 代碼執行時沒有錯誤,但我沒有在閃亮的應用程序中獲得顯示結果。使用RShiny和金字塔庫的顯示問題
這裏是server.R文件和文件UI.R有關代碼:
server.R:
output$effectifStartAgrege <- renderPlot({
staff <- read.xlsx('C:/file.xlsx', 1)
pyramid(staff, main = "Statistics")
})
ui.R:
shinyUI(fluidPage(
dashboardBody(
tabItems(
tabItem(tabName = "Team D",
tabBox(
title = "Team detailed compositions",
width = 400,
id = "tabset2", height = "250px",
tabPanel("START", "First tab content",
plotOutput("effectifStartAgrege")))
)
)
)
))
和輸出的dput(staff):
structure(list(Grade = structure(c(4L, 1L, 2L, 6L, 7L, 8L, 5L,
9L, 3L), .Label = c("AD", "AE", "AS/ED", "I", "M", "S1", "S2",
"S3", "SM"), class = "factor"), Assurance = c(6, 7, 0, 8, 7,
0, 7, 2, 4), Pension = c(0, 10, 0, 2, 3, 0, 2, 1, 2), Analytics = c(3,
3, 0, 2, 2, 0, 1, 1, 0)), .Names = c("Grade", "Assurance", "Pension",
"Analytics"), row.names = c(NA, -9L), class = "data.frame")
請加一些數據(將'dput(staff)'或'dput(staff [1:20,])''的輸出粘貼到你的文章中,以便我們可以運行該示例。 – NicE