Hi,
I am trying to use the following R code output from the ggplot_shiny() function, however when paste it into R I do not see any plot displayed. I am aware that I have to change df to the name of my dataframe. Note: I have version 4.1.0 of RStudio. Thank you in Advance!
library("ggplot2")
histogram <- ggplot(df, aes(x = Age, fill = Group.Code.CP)) +
geom_histogram(position = 'identity', alpha = 0.8, binwidth = 5) +
facet_grid( . ~ Group.Code.CP ) +
labs(x = 'Age (years)', y = 'Count') +
ggtitle('Age distribution by Experimental Group')+
labs(fill = 'Groups') +
theme_light() +
theme(
legend.position = 'right'
)
histogram