Re: how to use render.Text to create a data.frame table with Shiny?

441 views
Skip to first unread message

Joe Cheng

unread,
Jun 30, 2015, 5:57:59 AM6/30/15
to joseph.va...@myspartansublease.com, shiny-...@googlegroups.com
textOutput (and the probably more relevant verbatimTextOutput) can only render plain text. Are you sure that's what you want? If so, you could use verbatimTextOutput with renderPrint(data.frame(...)).

On Tue, Jun 30, 2015 at 10:23 AM <joseph.va...@myspartansublease.com> wrote:
Hi everyone,
 
Thanks ahead of time to anyone who takes to help out a new R guy!
 
I'm trying to create a highly customized HTML table in a Shiny application environment. I've already exhausted all efforts with renderTable and renderDataTable - I'm not satisfied with the output, so I would like to avoid such solutions. In short, I'd like to produce the following table with renderText and a data.frame input (simplistic example):
 
                    Values1    Values2     Values3
1/31/2015        100            75             90
2/28/2015        100            80             80
...
 
 
As it stands, I have the following line code as part of my ui.R:
 
mainPanel(textOutput("table1"))
 
 
And my server.R contains the following:
 
 
shinyServer(function(input, output) { 
 
# INPUT
Dates = as.Date(....)
Values1 = rbind(100, 100, ...)
Values2 = rbind(75, 80, ...)
Values3 = rbind(90, 80, ...)
 
# OUTPUT
output$table1 = renderText ({
    data.frame(Dates, Values1, Values2, Values3)
  })
})
 
 
And again, thanks to anyone who helps out! Go, R!
 
 

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/6e774128-9ef2-4589-8790-2359be912d6a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages