无法在闪亮的情况下运行cholesky分解。关闭'关闭'类型

时间:2016-03-02 09:10:10

标签: r shiny

我有一个相关矩阵。我尝试在该矩阵上运行cholesky分解函数chol(),然后通过t()函数对其进行转置,并将其保存在变量中。

correlation_matrix元素来自用户,值为:

    [,1] [,2] [,3]
[1,]  1.0  0.8  0.2
[2,]  0.8  1.0  0.7
[3,]  0.2  0.7  1.0

我在server.R中尝试使用以下代码来运行cholesky分解函数并对其进行转置,并且下面是我用来显示chsky_decomp输出的代码:

#Use Cholesky decomposition
  chsky_decomp <- eventReactive(input$corr_matrix_action, {
    data.frame(t(chol(correlation_matrix)))
  })

#Printing the entered correlation elements for the three varaibles 
  output$chesky_decomp_matrix <- renderDataTable({
    chsky_decomp()
  })

但我一直收到错误:cannot coerce type 'closure' to vector of type 'any'

eventReactive中尝试了各种格式,例如矩阵,列表等,但没有任何效果。我哪里错了?如何运行这两个函数chol()&amp;我t()上的correlation_matrix并显示了它?

我很有光泽。请帮忙!!

0 个答案:

没有答案