Cannot find ggplot2 R theme function package

I am currently working on a Debian server (for my internship) and I am using ggplot2 to plot.

So, I download the package by writing: require(ggplot2) (I also tried library(ggplot2) , the same result). However, the theme function is not recognized (which is a function of ggplot2 ).

To show you that the package is already installed, here is an example of one of my graphic objects generated using the ggplot2 functions:

And this is what I get when plotting using the function theme:

Graphics cannot be created because it cannot find the theme of the function. So I wanted to know if there are any tricks to load a function from the package, for example: ggplot2.theme

Or does this mean that R is not installed correctly on the server? (we followed the CRAN tutorial for the Debian server: https://cran.r-project.org/bin/linux/debian/ + for information, we installed the console package by writing: apt-get install r-cran-ggplot2 ).

 require(ggplot2) #Data data_y <- c(14, 111, 4, 12, 80, 105, 120, 88, 108, 119) data_x <- c("person1", "person2", "person3", "person4", "person5", "person6", "person7", "person8", "person9", "person10" ) #Dataframe data_xy <- data.frame(data_x, data_y) #Plot p <- ggplot(data_xy, aes(data_x, data_y)) p + geom_bar ( stat = "identity", fill = "steelblue1", colour = "grey", size = 1 ) + theme ( axis.text.x=element_text( angle=45, hjust=0.5, vjust=0.5 ) ) + theme_bw() 
+6
source share

All Articles