ggplot with hebrew labels

Viewed 217

I am trying to show in R while the x-axis is Hebrew. My code:

#server
shinyServer(  
  function(input, output, session) { 
    output$Plot <- renderPlot({
      temp<-data.frame(x=c("ראשון","שני","שלישי"),y=c(1,2,3))
      ggplot(temp, aes(x = x, y = y)) + geom_point() 
    })
  })

#ui
shinyUI(fluidPage(
  sidebarLayout(
    sidebarPanel(), 
    mainPanel("main panel", 
      plotOutput('Plot'))
  )
))

The plot that I am getting is: enter image description here

The letters in x-axis are ordered wrongly.

The same plot outside shiny works with no problems.

Any idea how to fix that?

Thanks

0 Answers
Related