2017-04-25 105 views
-1

我的数据看起来就像是按照数据帧显示的数据帧的数据到表R:如何使用闪亮

X 
a  date  b  c d  e  f  g  h  i 
1 7 Jan 17 80 80 -4 26 58 16 12 12 

我想表明,在闪亮的表视图此数据。

ui.r我曾经做过如下:

tableOutput("futureData") 

server.R我要显示在表

output$futureData <- renderTable() 

该数据帧的数据,应该怎么办?

+0

欢迎来到Stack Overflow!我通过在SO上使用的markdown替换了html格式。 – Uwe

+0

前一天提出了一个相关问题:http://stackoverflow.com/questions/43590702/i-have-read-csv-file-and-want-to-show-table-format-in-r-using -shiny – Uwe

回答

1

请尝试

output$futureData <- renderTable(
    { 
    X <- data.frame(a = 1L, date = "7 Jan 17", b = 80L, c = 80L, d = -4L, 
        e = 26L, f = 58L, g = 16L, h = 12L, i = 12L) 
    return(X) 
    } 
) 

注意return(X)可以通过一个单一的X更换。