小编Mic*_*jka的帖子

单击即可关闭闪亮的应用程序

当用户点击按钮时,应用程序结束Q。我希望这个应用程序在用户点击Quit 导航栏时结束。不幸的是,我无法弄清楚如何做到这一点。将不胜感激任何帮助!

编辑:知道如何将Quit选项卡向右移动会很棒:)

ui <- shinyUI(navbarPage(title = "Test", 
        tabPanel(title = "Content",
                 actionButton(inputId = "quit", label = "Quit")
        ),
        tabPanel(title = "Quit", icon = icon("circle-o-notch"))
        )
)

server <- shinyServer(function(input,output) {
  observe({
    if (input$quit == 1) stopApp()
  })
})

shinyApp(ui, server)
Run Code Online (Sandbox Code Playgroud)

css onclick shiny

6
推荐指数
1
解决办法
2404
查看次数

使用 R 基础图形的堆叠直方图

使用ggplot2它很容易创建堆叠直方图:

library(ggplot2)

ggplot(data = iris, aes(x = Sepal.Length, fill = Species)) + 
  geom_histogram(colour = 'white') 
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

ggplot(data = iris, aes(x = Sepal.Length, fill = Species)) + 
  geom_histogram(colour = 'white', position = 'fill')
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

我想知道如何仅使用R 基础图形创建两个直方图。

r histogram ggplot2

5
推荐指数
1
解决办法
4742
查看次数

加载屏幕和导航栏页面

我尝试制作一个加载屏幕,就像这个很好的例子http://daattali.com:3838/loading-screen/ 一样。不幸的是,我无法弄清楚如何使用“navbarPage”来实现完全相同的效果。

在下面这个稍微修改的应用程序中有两个选项卡面板,称为“开始”和“结束”。当应用程序启动时,没有任何选项卡面板处于活动状态。必须快速单击第一个选项卡才能看到加载屏幕,但这不是我想要的。有没有办法让它像上面提到的例子一样快速和简单?

感谢您的帮助!

library(shinyjs)

appCSS <- "
#loading-content {
position: absolute;
background: #000000;
opacity: 0.9;
z-index: 100;
left: 0;
right: 0;
height: 100%;
text-align: center;
color: #FFFFFF;
}
"

shinyApp(
  ui = navbarPage(
    useShinyjs(),
    inlineCSS(appCSS),

    tabPanel(title = "Start",

      # Loading message
      div(
        id = "loading-content",
        h2("Loading...")
      ),

      # The main app code goes here
      div(
        id = "app-content",
        p("This is a simple example of a Shiny app with a loading screen."),
        p("You can view the source code", …
Run Code Online (Sandbox Code Playgroud)

r shinyjs

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

改变小部件的样式

我想知道如何用css(标签$ style())改变"radioButton"和"checkboxInput"小部件的样式.

任何帮助表示赞赏!谢谢!

library(shiny)

ui <- shinyUI(fluidPage(
  h3("Hi! I would like to know how to change the style of these widgets with css (tag$style)"),
  h3("I can change the style of sliders, unfortunately I cannot figure out how to do this with 'radioButtons'
     and 'checkboxInput'. I usually inspect HTML-element in my browser and look for the css style, in this case this strategy does not work."),
  br(),
  br(),
  radioButtons(inputId = "ex_radio", label = "How to change my style?",
               choices = c("I …
Run Code Online (Sandbox Code Playgroud)

r shiny

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

标签 统计

r ×3

shiny ×2

css ×1

ggplot2 ×1

histogram ×1

onclick ×1

shinyjs ×1