R闪亮的矩阵或表格输入

时间:2017-08-31 13:00:37

标签: r shiny rhandsontable

我想创建一个矩阵或表作为输入,供用户在Shiny中进行交互。

例如:

sample name             number of tests
350292                  3
...                     ...

我想在mainPanel中自动生成标签,供用户输入不同样本的数据。

matrixInput包中的shinyIncubator可以实现此功能,但matrixInput功能不支持列名称。

有更好的方法吗?

更新

我尝试了rhandsontable包。

代码:

library(shiny)
library(rhandsontable)

DF <- data.frame(name=c(350292, 360765), run=c(3,2))
colnames(DF) <- c("sample name", "number of tests")

ui <- fluidPage(
  headerPanel("test"),
  mainPanel(rHandsontableOutput("sample"))
)

server <- function(input, output) {
  output$sample <- renderRHandsontable({
    rhandsontable(DF, rowHeaders = NULL) %>%
     hot_col(c("sample name", "number of tests"), format = "0")
  })
}

shinyApp(ui = ui, server = server)

如何使用reactive()rhandsontable来调用值?

我想根据样本名称和测试编号创建标签。

0 个答案:

没有答案