问题
Sorry to bother you with what is for sure a very simple mistake, but I still cannot figure it out by myself:
library(ggplot2)
X = rep(c(1:6),3)
Y = rep(c(1:6),3)
group = rep(c(1:3), each = 6)
data = data.frame(X = X, Y = Y, group = group)
ggplot(data, aes(x = X, y = Y, group = group)) + geom_point()
I do not get any output from this, no figure is created. What am I doing wrong here?
Thanks a lot in advance! Gero
回答1:
Try print the plot if you are calling it from another function or in Shiny:
myplot <- ggplot(data, aes(x = X, y = Y, group = group)) + geom_point()
print(myplot)
来源:https://stackoverflow.com/questions/46034581/no-output-from-ggplot