Programmers learn & share
+1 vote
766 views

Problem :

I am facing error related to ggproto as following
error: cannot add ggproto objects together. did you forget to add this object to a ggplot object?
by (6.9k points)   | 766 views

1 Answer

0 votes

Solution :

You can resolve your issue by defining a list of the ggplot terms you want and add them in.

library(ggplot2)

my.scale_aes <- list(
  scale_x_continuous(breaks = c(56, 60, 61)),
  scale_color_manual(values = c("black", "red"))
)

diamonds[1:100,] %>%
  ggplot(aes(depth, price, color = cut == "Ideal")) +
  geom_point() +
  my.scale_aes 
by (36.1k points)  
2,245 questions
2,807 answers
60 comments
241 users