小编czq*_*qiu的帖子

如何为slidebar(sliderInput)着色?

我尝试为R闪亮的一些silderInput栏制作不同的颜色.它需要css等我在线看,只能找到如何制作一个silderInput.如何为不同的条形图创建几种不同的颜色?

这是我的测试代码.它将显示相同风格的所有栏:

 ui <- fluidPage(
   tags$style(type = "text/css", "
              .irs-bar {width: 100%; height: 25px; background: black; border-top: 1px solid black; border-bottom: 1px solid black;}
              .irs-bar-edge {background: black; border: 1px solid black; height: 25px; border-radius: 0px; width: 20px;}
              .irs-line {border: 1px solid black; height: 25px; border-radius: 0px;}
              .irs-grid-text {font-family: 'arial'; color: white; bottom: 17px; z-index: 1;}
              .irs-grid-pol {display: none;}
              .irs-max {font-family: 'arial'; color: black;}
              .irs-min {font-family: 'arial'; color: black;}
              .irs-single {color:black; background:#6666ff;}
              .irs-slider {width: 30px; height: 30px; top: 22px;} …
Run Code Online (Sandbox Code Playgroud)

r colors shiny

15
推荐指数
2
解决办法
5605
查看次数

为什么ncol选项在R中的facet_grid中不起作用

我正在尝试用facet学习ggplot.这里的代码适用于Rstudio

p <- ggplot(mtcars, aes(mpg, wt)) + geom_point()

  # With one variable
p + facet_grid(. ~ cyl)
Run Code Online (Sandbox Code Playgroud)

但是,在我添加ncol = 2后,它显示ncol的错误:

    p + facet_grid( ~ cyl,ncol=2)

Error in facet_grid(~cyl, ncol = 2) : unused argument (ncol = 2)
Run Code Online (Sandbox Code Playgroud)

r facet r-grid

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

标签 统计

r ×2

colors ×1

facet ×1

r-grid ×1

shiny ×1