标签: shiny

横向的闪亮数据表

我在闪亮的代码如下

DT::renderDataTable({ 
  df()
  , rownames=FALSE
  ,extensions = c('Responsive', 'Buttons')
  , options = list(
    # dom = 'C<"clear">T<"clear">lfrtip'
    # , tableTools=list(sSwfPath = copySWF('www'))
    dom = 'Bfrtip'
    , buttons = c('pageLength'
                  , 'colvis'
                  , 'pdf')
    , orientation ='landscape'
    , lengthMenu = list(c(6, 12, 18, -1), c('6', '12', '18', 'All'))
    , pageLength = 12
    )
  )
}
})
Run Code Online (Sandbox Code Playgroud)

我想横向下载pdf。我应该怎么做。

根据以下链接:https : //datatables.net/reference/button/pdf,我们可以将方向作为景观。但是,我无法做到。

我尝试了以下方法:

DT::renderDataTable({ 
  df()
  , rownames=FALSE
  ,extensions = c('Responsive', 'Buttons')
  , options = list(
    # dom = 'C<"clear">T<"clear">lfrtip'
    # , …
Run Code Online (Sandbox Code Playgroud)

r datatables shiny

0
推荐指数
1
解决办法
960
查看次数

R简易日期解析

我有一个数据集,df$Date其格式为18-Sep-2016,所以不是很有用.我怎么能轻易转换这个,所以我可以在一个Shiny app中使用它sliderInput

r shiny

0
推荐指数
1
解决办法
82
查看次数

如何用闪亮或R代码计算两个圆的相交面积

任何人都有关于如何计算两个圆的相交面积的闪亮代码或R代码?

ui

图书馆(闪亮)

定义用于绘制直方图的应用程序的UI

ShinyUI(fluidPage(

#应用程序标题titlePanel(“选择您的概率”),

#带有用于箱数的滑块输入的侧栏sidebarLayout(sidebarPanel(

  sliderInput("radius",
              "Probability of A",
              min = 0,
              max = 0.4,
              value = 0.2),
  sliderInput("radius2",
              "Probability of B",
              min = 0,
              max = 0.4,
              value = 0.2)
),
mainPanel(
  plotOutput("distPlot")
)
Run Code Online (Sandbox Code Playgroud)

))

服务器

库(发光)库(plotrix)库(网格)

定义绘制直方图所需的服务器逻辑

ShinyServer(函数(输入,输出){

output $ distPlot <-renderPlot({

isolate({
  plot(c(-1,1),c(-1,1), type = 'n')


})

draw.circle(-0.25,0,input$radius)
draw.circle(0.25,0,input$radius2)
Run Code Online (Sandbox Code Playgroud)

})

})

statistics r shiny

0
推荐指数
1
解决办法
428
查看次数

不需要时,在R Shiny中禁用selectInput

我正在构建一个shiny包含两个表单的网页selectInput:第一个 - 静态 - 在ui部分中,第二个 - 动态 - 在server部分中.下面显示了真实问题的简化.

require(shiny)

ui <- fluidPage(

    # The static input
    selectInput(inputId = 'static',
                label = 'Make a choice',
                choices = c('A', 'B', 'C'),
                selectize = FALSE),

    # The dynamic input
    uiOutput(outputId = 'dynamicInput'),

    # The output
    hr(),
    strong('This is a check for the output:'),
    textOutput(outputId = 'check')

)

server <- function(input, output, session) {

    # The dynamic input definition
    output$dynamicInput <- renderUI({

        # This input …
Run Code Online (Sandbox Code Playgroud)

r shiny

0
推荐指数
1
解决办法
1822
查看次数

从R Shiny App输出纯HTML文件

我希望部署我的R Shiny App,但是我不能使用通过runapp命令并将IP设置为0.0.0.0的标准方法。我想知道是否有什么方法可以输出包含ui.R和server.R功能的纯HTML文件,以便我可以使用每天生成的纯HTML文件进行部署。R / Shiny是否有可能产生一个既包含ui元素又模拟server.R功能/反应性的index.html文件?

html r shiny

0
推荐指数
1
解决办法
4359
查看次数

更新到R版本3.4.2后,pandoc文档转换失败,错误1

更新到R版本3.4.2后,我的flexdashboard文档闪亮不再起作用.

即使我尝试运行该示例的副本https://jjallaire.shinyapps.io/shiny-biclust/
我得到了

'错误:pandoc文档转换失败,错误1'

.

到目前为止,我在网络搜索期间找不到该错误的答案.我还更新了所有包裹.

我的sessionInfo:

R version 3.4.2 (2017-09-28)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=German_Austria.1252  LC_CTYPE=German_Austria.1252    LC_MONETARY=German_Austria.1252
[4] LC_NUMERIC=C                    LC_TIME=German_Austria.1252    

attached base packages:
[1] grid      stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] biclust_1.2.0    lattice_0.20-35  colorspace_1.3-2 MASS_7.3-47     

loaded via a namespace (and not attached):
 [1] flexclust_1.3-4   Rcpp_0.12.13      digest_0.6.12     rprojroot_1.2     jsonlite_1.5      backports_1.1.1  
 [7] stats4_3.4.2      magrittr_1.5      evaluate_0.10.1   stringi_1.1.5     rpart_4.1-11      rmarkdown_1.7    
[13] flexdashboard_0.5 tools_3.4.2 …
Run Code Online (Sandbox Code Playgroud)

r shiny flexdashboard

0
推荐指数
1
解决办法
6079
查看次数

将图像放在R Shiny中navbarPage()布局中导航栏的右端

我希望复制与RStudio的SuperZip Shiny仪表板类似的布局,可在此处使用:https ://shiny.rstudio.com/gallery/superzip-example.html

该应用程序的代码可在此处获取:https : //github.com/rstudio/shiny-examples/tree/master/063-superzip-example

根据该代码,我想在导航栏的右端添加一个图像(假设为Rstudio徽标),并在下图中用红色框突出显示。我认为我需要添加一些HTML和CSS代码,但不确定如何继续。

在此处输入图片说明

我的问题类似于以下问题:如何将图像插入闪亮的navbarPage()上的导航栏中

但是,请注意,答案提供了将图像放在导航栏的左端的指示。我要求将其放在导航栏的右端。

r shiny

0
推荐指数
1
解决办法
1968
查看次数

r闪亮防止在numericInput为空时使应用程序崩溃

我有一个非常简单的闪亮应用程序正在运行。用户在框1上输入一个值,然后在框2中输入一个值,然后单击“运行”。

但是,当用户在两个numericInput单元格之一中按退格键直到没有输入任何内容时,应用程序就会崩溃。

如何防止它崩溃?非常感谢你!

library(shiny)
library(shinyjs)

ui <- fluidPage(
  useShinyjs(),
  actionButton("run", label = "Run calculations!"),
  # Input 1
  numericInput("inNumber1", label = "Input number 1", 
               value = 100, min = 10, max = 200, step = 10),
  # Message that shows up if the value of inNumber1 is outside the allowed range:
  hidden(h5("Enter a value between 10 and 200!",
            id = "message1",
            style = "font-weight:bold;color:orange;")),

  uiOutput("inNumber2"),
  # Message that shows up if the value of inNumber1 is outside the allowed range:
  hidden(h5("Enter …
Run Code Online (Sandbox Code Playgroud)

r shiny numeric-input

0
推荐指数
1
解决办法
610
查看次数

限制从闪亮的几个下拉列表中选择的选项数量

我正在创建一个时间趋势图,用户可以在其中选择不同类型(例如国家/地区)的不同地理位置,每种类型都有自己的下拉框。我想将他们可以选择的地理位置数量限制为4个。我知道如何对一个下拉列表(options = list(maxOptions = 4))进行操作,但是当您从多个下拉列表中进行选择时,我无法弄清楚如何对其进行限制。对于这些地区中的每个地区,都有大量选项,因此将它们组合到一个下拉列表中是不可行的。任何帮助,将不胜感激!

我准备了一个小例子来说明我的意思:

library(plotly)
library(dplyr)

# Global variables
cities <- c("City A", "City B", "City C", "City D", "City E")
regions <- c("Region M", "Region N", "Region O")
countries <- c("Country Z", "Country X", "Country Y", "Country W")
geography_all <- as.factor(c(cities, regions, countries))
year <- as.factor(2011:2014)

df <- expand.grid(geography = geography_all, year = year)
df$value <- runif(48)

trend_pal <-  c('red','blue', 'yellow', 'green') #Palette


# UI
ui <- fluidPage(
  selectInput("cities", "City", choices = cities,
              multiple=TRUE, selectize=TRUE, …
Run Code Online (Sandbox Code Playgroud)

r shiny

0
推荐指数
2
解决办法
887
查看次数

如何在Shiny中将titlePanel居中?

在R的Shiny包中,如何使titlePanel中的文本居中于页面顶部?

这是我的意思的一个例子

我用于titlePanel的唯一代码是:

ui <- fluidPage(
  titlePanel("How to Centre Me??")
Run Code Online (Sandbox Code Playgroud)

当我查看文档时,该函数采用的唯一变量是:

titlePanel(title, windowTitle = title)
Run Code Online (Sandbox Code Playgroud)

这样可以将标题居中吗?

谢谢

r shiny

0
推荐指数
2
解决办法
3717
查看次数

标签 统计

r ×10

shiny ×10

datatables ×1

flexdashboard ×1

html ×1

numeric-input ×1

statistics ×1