这是数据文件的链接,您可以将其转换为txt格式。 https://docs.google.com/document/d/1agR2wu82vBBv99DbmdXAQwyS9PF6nUUaKA1bGPH6eno/edit?usp=sharing
Here is the screenshot for the cutoff 当我将筛选器添加到闪亮的仪表板中的数据表时,筛选器的下拉框将被切除。是否可以解决此问题?(例如,对于“种类”列,过滤器下拉框未显示两个选项的整体外观,我需要以某种方式加宽下拉框。)可以在Rstudio中复制的代码:
library(shinydashboard)
library(ggplot2)
library(DT)
sidebar <- dashboardSidebar(
sidebarMenu(
menuItem("Summary", tabName = "summary"),
menuItem("Analysis", tabName = "analysis")
)
)
body <- dashboardBody(
tabItems(
tabItem(tabName = "summary",
fluidRow(
#column(width = 4,
box(
title = "Studies", width = 12, status = "danger", solidHeader = TRUE,
div(style = 'overflow-y: scroll; max-height: 600px', DT::dataTableOutput('table'))
#div(style = 'overflow-y: scroll; max-height: 300px', tableOutput('table'))
)
#)
),
hr(),
fluidRow(
box(
title = "Type of cancer", status = "warning", width = 6, plotOutput("hist1")
),
box(
title = "Data type", status = "warning", color="yellow", width = 6, plotOutput("DataType"))
)
),
tabItem(tabName = "analysis", h2("Analysis and plots"))
)
)
ui <- dashboardPage(
dashboardHeader(title = "Cancer research updates", titleWidth = 300),
sidebar,
body
)
server <- function(input, output) {
#test.table <- data.frame(lapply(1:3, function(x) {1:20}))
#names(test.table) <- paste0('This_is_a_very_long_name_', 1:3)
pcdata <- read.csv("./data/ProstateCancerInput_Final.txt", sep = "\t", encoding = 'UTF-8')
colnames(pcdata)[1] <- ''
colnames(pcdata)[6] <- 'Data type'
colnames(pcdata)[9] <- 'Type of cancer'
pcdata$Link <- paste0("<a href ='",pcdata$Link,"'>","Link to data","</a>")
output$table <- DT::renderDataTable({
#test.table
datatable(pcdata, rownames = FALSE, escape = FALSE,filter = 'top')
})
#windowsFonts(Arial=windowsFont("TT Arial"))
}
shinyApp(ui = ui, server = server)