闪亮的textOutput换行

时间:2015-04-10 13:18:35

标签: r shiny

我有一个对象列表,其中一个是随机森林模型的预测。

数据如下:

 print(a$predict)
 1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 
 B  A  B  A  A  E  D  B  A  A  B  C  B  A  E  E  A  B  B  B 

我正试着将它打印成一个闪亮的应用程序。

在我的server.R文件中,我有:

output$prediction <- renderPrint({
    input$process

    withProgress(message = 'Making prediction. Please wait', value = 0.1, {

      isolate(
        print(modelset()$predict))
    })})

在我的UI.R文件中,我有:

tabPanel('Prediction', textOutput('prediction'))

问题在于闪亮的应用程序将对象输出为1长字符串:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 B A B A A E D B A A B C B A E E A B B B Levels:A B C D E

如何以与我们在R studio中看到的相同的方式获得打印输出?

提前致谢。

1 个答案:

答案 0 :(得分:1)

没关系,我明白了。我需要更换

textOutput

 verbatimTextOutput
相关问题