小编Vin*_*Lin的帖子

如何更改 Shinydashboard 中侧边栏的字体大小

我是闪亮仪表板的新手,不熟悉 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)

r shiny shinydashboard

4
推荐指数
1
解决办法
4382
查看次数

如何在ggmap中获得前N个最大密度点坐标

我有关于热图的问题.我可以通过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)

在此输入图像描述 结果如图所示,有3个地方脱颖而出,但我怎样才能在这些区域的中间得到拉特和长?(红点)

r ggplot2 ggmap

2
推荐指数
1
解决办法
385
查看次数

标签 统计

r ×2

ggmap ×1

ggplot2 ×1

shiny ×1

shinydashboard ×1