I have this code in R:
p <- ggplot(data, aes(x = Price, y = ActionsCount))
p + geom_point(alpha = 0.25, aes(color = Medium))
p + coord_cartesian(xlim=c(0,300), ylim=c(0,40))
p + facet_wrap( ~ Medium)
And the console returns: No layers in plot
If I launched only the first two rows, a chart is plotted.But if I want to run all the code, there is the error no layers in plot after processing coord_cartesian command and alse after processing p + facet_wrap( ~ Medium).
Data are loaded by sqldf:
data <- sqldf("SELECT User.V1 as Id, User.V7 as Source, User.V8 as Medium, CAST(User.V3 as Int) as Price, count(*) as ActionsCount FROM User)
Thank you for your help.
You're not updating
p
every time.