R 更改闪亮仪表板标题板中的字体颜色
我试图将仪表板的标题设置为红色,但当我试图在标题面板中传递style参数时,我得到一个错误,即该参数未使用。我做错了什么R 更改闪亮仪表板标题板中的字体颜色,r,shiny,R,Shiny,我试图将仪表板的标题设置为红色,但当我试图在标题面板中传递style参数时,我得到一个错误,即该参数未使用。我做错了什么 library(shiny) # Define UI for application that draws a histogram ui <- fluidPage( # Application title titlePanel("Old Faithful Geyser Data", style = "color: #FF
library(shiny)
# Define UI for application that draws a histogram
ui <- fluidPage(
# Application title
titlePanel("Old Faithful Geyser Data", style = "color: #FFFFFF"),
# Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
sliderInput("bins",
"Number of bins:",
min = 1,
max = 50,
value = 30)
),
# Show a plot of the generated distribution
mainPanel(
plotOutput("distPlot")
)
)
)
# Define server logic required to draw a histogram
server <- function(input, output) {
output$distPlot <- renderPlot({
# generate bins based on input$bins from ui.R
x <- faithful[, 2]
bins <- seq(min(x), max(x), length.out = input$bins + 1)
# draw the histogram with the specified number of bins
hist(x, breaks = bins, col = 'darkgray', border = 'white')
})
}
# Run the application
shinyApp(ui = ui, server = server)
将其包装在
div
中,如下所示
titlePanel(div(“老忠实间歇泉数据”,style=“color:#FF0000”))
将其包装在div中,作为titlePanel(div(“老忠实间歇泉数据”,style=“color:#FF0000”)
@YBS,这很有效!你想提交答案,然后我可以接受并关闭吗?
Error in titlePanel("Old Faithful Geyser Data", style = "color: #FFFFFF") :
unused argument (style = "color: #FFFFFF")