我是闪亮仪表板的新手,不熟悉 CSS,谁能告诉我如何更改闪亮仪表板中侧边栏的字体大小?非常感谢,下面是我的代码。
library('shinydashboard')
library(shiny)
ui <- dashboardPage(
dashboardHeader(title = 'Test'),
dashboardSidebar(
sidebarMenu(
menuItem('Tab1', tabName = '1', icon = icon('dashboard')),
menuItem('Tab2', tabName = '2', icon = icon('th'))
)),
dashboardBody(tabItems(
#First tab content
tabItem(tabName = '1',
fluidRow(
box(plotOutput('plot1', height = 250)),
box(tilte = 'Controls',
sliderInput('slider', 'Number of obs', 1, 100, 50))
)),
#Second tab content
tabItem(tabName = '2',
h2('Some text here'))
))
)
server <- function(input, output) {
set.seed(122)
histdata <- rnorm(500)
output$plot1 <- renderPlot({
data <- histdata[seq_len(input$slider)]
hist(data)
})
}
shinyApp(ui, …Run Code Online (Sandbox Code Playgroud) 我有关于热图的问题.我可以通过ggmap可视化热图,并将眼球放在最密集的位置,但我怎样才能得到这些斑点的精确长度和纬度.这是测试代码:
set.seed(1)
mymap <- get_map(location = "Detroit", zoom = 8)
mydata <- data.table(long = runif(min = -84, max = -82.5, n = 100),
lat = runif(min = 42, max = 42.7, n = 100))
g <- ggmap(mymap) +
stat_density2d(data = mydata,
aes(x = long, y = lat, fill = ..level..,alpha = ..level..),
size = 0.5, bins = 10, geom = "polygon") +
scale_alpha_continuous(range(0.1,0.5))
g
Run Code Online (Sandbox Code Playgroud)