I am trying to use grid.arrangeand am thus assigning my plots to variables.
Plotting my data as a scatter plot works perfectly fine.
ggplot(df, aes(x=log(x), y=log(y), color=Category))+ geom_point()
But when I assign this to a variable I get an error message
g <- ggplot(df, aes(x=log(x), y=log(y), color=Category)) +
geom_point()
g
Error: unexpected numeric constant in "g 1"
Why is this the case?
Best Regards Pete