2017-04-25 102 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更換。