[R] ggplot2 not displaying graph in RH7 RStudio Server 3.2.3

phiroc at free.fr phiroc at free.fr
Wed May 18 09:32:47 CEST 2016


Hello,

I have written an R script which displays a bar chart using the ggplot2 library (please refer
to code excerpt at the bottom of this e-mail).

Although the bar chart is displayed OK in the Windows version of RStudio (v. 3.2.4),
nothing appears on Linux RH 7 in Rstudio Server 3.2.3.

I have tried replacing the data frame in the RH-version of the script by 

---------------------------------------------------------------------------

a <- c("ab", "bc", "cd")
b <- c(1, 2, 3)
ds <- data.frame(a,b)
g1 <- ggplot(data = ds, aes(x = a))


----------------------------------------------------------------------------

... but to avail: ggplot doesn't plot anything. No error message are displayed.

Any help with this issue would be much appreciated.

Many thanks.

phiroc


----------------------------- R Code Excerpt -------------------------------


g1 <- ggplot(data = mergedD, aes(x=DESC_TYPE))
g1 + geom_bar(stat="count", fill=rainbow(numberOfDistinctActions), colour="black") +
  xlab("Action & Description") +
  ylab("Count")  +
  ggtitle(paste0(
  "Number of Customer Actions in XXX from ", day0, "/", mon,
  "/", year, " to ", day1, "/", mon, "/", year,
  " in Paris & Hong Kong")) +
  coord_flip()



More information about the R-help mailing list