It's possible add greek letter with renderTable?

673 views
Skip to first unread message

Ivan Bezerra Allaman

unread,
Mar 5, 2013, 11:48:46 AM3/5/13
to shiny-...@googlegroups.com
Good afternoon gentlemen!

I would like to include Greek letters on my table. Here is a part of the script to further elucidate my doubt.

.
.
.
 sliderValues <- reactive({

              #
             data.frame(
                         Estatísticas = c('mu',   #here!
                                           "sigma",   #here!
                                           "dqm",
                                           "s2"),        #s^2???
                         Valores = as.character(c(input$mu,
                                                  input$sigma,
                                                  dqma(),
                                                  s2())),
                         stringsAsFactors=FALSE)
            })                                   

 output$view <- renderTable({
              sliderValues()
            }) 
.
.
.

Thanks!!

Joe Cheng

unread,
Mar 5, 2013, 5:28:19 PM3/5/13
to shiny-...@googlegroups.com
Hi Ivan, what happens when you run this?


--
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.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ivan Bezerra Allaman

unread,
Mar 5, 2013, 9:34:18 PM3/5/13
to shiny-...@googlegroups.com
Hi Joe!

I've tried "mu", "$mu$", "$\\mu$" and appears "mu", "$mu$" and "$\mu$" respectively and not the Greek letter as I would like. I looked in several places how to insert Greek letters in data.frame, and found nothing. I know that with graphics you can use the expression function, more data.frame not know and have not found how to do this. Researched here in the group too, but it seems that nobody has gone through something similar. From what I've researched, it is the function xtable behind the constructions of the tables, so I thought that a simple "$ \ \ mu $" was enough. Most did not work. Any suggestions?

Thank you.

Winston Chang

unread,
Mar 5, 2013, 9:41:56 PM3/5/13
to shiny-...@googlegroups.com
Have you tried using '𝚺' and  'μ'? (Hopefully those will appear correctly for you)

-Winston

Ivan Bezerra Allaman

unread,
Mar 6, 2013, 12:42:15 PM3/6/13
to shiny-...@googlegroups.com
Hi Winston!

How???? I do not see how to insert symbols, greek letters except for commands like $ \ mu $, $ \ sigma $, etc.. The way you posted, I see the possibility using the toolbar windows in which you ask to enter a particular symbol. Any suggestions?

Winston Chang

unread,
Mar 6, 2013, 12:47:37 PM3/6/13
to shiny-...@googlegroups.com
I just used the character browser (under Edit -> Special Characters) on my Mac. Perhaps you can copy and paste these characters into your code?

Ivan Bezerra Allaman

unread,
Mar 6, 2013, 1:29:10 PM3/6/13
to shiny-...@googlegroups.com
Hummmmmmmmmmmmmmmmmmmmmmm! It's like I say: Why to complicate?

Thanks!

Jason Dalton

unread,
Jul 2, 2013, 12:39:44 PM7/2/13
to shiny-...@googlegroups.com
Did this work for you?  I ran across the same problem, importing and displaying a CSV with text like "Units,µg/kg (ppb)".
I get an "Input string 2 is invalid at this locale"  error message when i try to render a table from that data.

Joe Cheng

unread,
Jul 2, 2013, 4:59:13 PM7/2/13
to shiny-...@googlegroups.com
Hi Jason, are you on Windows?

Jason Dalton

unread,
Jul 2, 2013, 5:05:16 PM7/2/13
to shiny-...@googlegroups.com
I'm on Mac OSX 10.8.3

As a workaround, I applied gsub to the data frame to swap the mu for a lowercase 'u', but I'd much rather have the original text.

Joe Cheng

unread,
Jul 2, 2013, 5:26:33 PM7/2/13
to shiny-...@googlegroups.com
Is the CSV file encoded with UTF-8? If so, I would expect that to work. If it's UTF-8 and still not working, can you send me the contents of your sessionInfo()? Thanks.
Reply all
Reply to author
Forward
0 new messages