小编Ric*_*ard的帖子

禁用选择输入闪亮

我的闪亮应用程序还有另一个问题。目标是在用户按下 actionButton 时禁用我的应用程序中的某些输入。我找到了这个解决方案,它适用于文本输入和数字输入,但奇怪的是不适用于 selectinput 或 selectizeinput。我知道该解决方案以某种方式包含使用 javascript,但我不知道如何使用。

在此先感谢您的帮助!

编辑:

可能我说的还不够清楚。对不起大家!我将添加必要的代码块。

这是链接中的禁用功能。它适用于 actionButtons 和数字输入,但不适用于选择或选择输入。

 disableActionButton <- function(id,session) {
  session$sendCustomMessage(type="jsCode",
                            list(code= paste("$('#",id,"').prop('disabled',true)"
                                             ,sep="")))
    disableselectButton <- function(id,session) {
  session$sendCustomMessage(type="jsCode",
                            list(code= paste("$('#",id,"').prop('select',false)"
                                             ,sep="")))

    disableselectButton <- function(id,session) {
  session$sendCustomMessage(type="jsCode",
                            list(code= paste("$('#",id,"').prop('hide',false)"
                                             ,sep="")))
Run Code Online (Sandbox Code Playgroud)

这是未禁用的输入示例。正如我所说,解决方案可能在于 javascript,但老实说,我什至不知道基本原理。我尝试了不同的问题,例如 hide=true oder select=false,但没有用(您也可以看到上面没有用的函数)。

selectInput("algorithmicMethod1",
                                label=h5("Berechnungsalgorithmus erster Wahl"),
                                c("RoT","Pickands"),
                                selected="RoT"),

                    conditionalPanel(condition="input.algorithmicMethod1 =='RoT'",

                                     selectInput("algorithmicMethod2",
                                                 label=h5("Berechnungsalgorithmus zweiter Wahl"),
                                                 "Pickands",
                                                 selected="Pickands")),

                    conditionalPanel(condition="input.algorithmicMethod1 =='Pickands'",

                                     selectInput("algorithmicMethod2",
                                                 label=h5("Berechnungsalgorithmus zweiter Wahl"),
                                                 "RoT",
                                                 selected="RoT"))
Run Code Online (Sandbox Code Playgroud)

那么,有没有其他方法可以禁用选择/选择输入?

再次感谢。:)

javascript r shiny

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

闪亮的用户界面:保存输入中的更改

我有一个很大的问题.我正在尝试运行一个具有相当多设置的程序,可以在ui中设置.在我的情况下,用户可能需要多次使用相同的设置运行程序.我的问题是,如果刷新或重新启动UI,则所有内容都将设置为默认值.例如:

numericInput("1", 
            label = h4("...."),
                                        4,
                                        min=1, 
                                        max=100, 
                                        step=1 
                                        ),
                           br(),
                           numericInput("2", 
                                        label = h4("..."),
                                        1000000,
                                        min=1, 
                                        max=100000000, 
                                        step=1
                                        )
Run Code Online (Sandbox Code Playgroud)

如果我将numericInput"1"设置为7,并重新运行程序,默认情况下为4.由于我有很多这样的设置,这可能是一个非常棒的嗡嗡声.所以我的问题是:"有没有办法保存我所做的改变?"

谢谢:)

r shiny

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

DCC-GARCH的实现

我在R中实现DCC-GARCH时遇到一些问题.当我在R中运行以下代码时,我总是得到相同的错误消息:

UseMethod中的错误("收敛"):没有适用于"收敛"的方法应用于类"try-error"的对象

不幸的是我不知道如何解决这个问题......

    install.packages("fGarch")
    install.packages("rugarch")
    install.packages("rmgarch")
    library(fGarch)
    library(rmgarch)
    library(rugarch)
    library(tseries)
    library(zoo)

    #Daten runterladen
    ibm <- get.hist.quote(instrument = "DB",  start = "2005-11-21",
                  quote = "AdjClose")
    sys<- get.hist.quote(instrument = "^STOXX50E",  start = "2005-11-21",
                 quote = "AdjClose")

    #Returns
    retibm<-diff(log(ibm))
    retsys<-diff(log(sys))

    # univariate normal GARCH(1,1) for each series
    garch11.spec = ugarchspec(mean.model = list(armaOrder = c(0,0)), 
                      variance.model = list(garchOrder = c(1,1), 
                                            model = "sGARCH"), 
                      distribution.model = "norm")

    # dcc specification - GARCH(1,1) for conditional correlations
    dcc.garch11.spec = dccspec(uspec = multispec( replicate(2, garch11.spec) ), 
                       dccOrder = …
Run Code Online (Sandbox Code Playgroud)

statistics runtime-error r time-series

3
推荐指数
1
解决办法
1159
查看次数

Julia: Finding values larger than 0 in vector with missing

I'm fairly new to Julia and as a Matlab/R User I find it, for the most part, really nice to work with.

However, I'm a little confused by the missing values and how to work with them.

Let's say I have a vector:

a=[missing -1 2 3 -12] #Julia
a=[NaN -1 2 3 -12] #Matlab
Run Code Online (Sandbox Code Playgroud)

In Matlab I would just do the following to find the values below 0

a(a<0)
Run Code Online (Sandbox Code Playgroud)

which gives me

-1 -12
Run Code Online (Sandbox Code Playgroud)

The same unfortunately doesn't work …

missing-data julia

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