• Register
1 vote
3.2k 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?
6.9k points

Please log in or register to answer this question.

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 
38.6k points

Related questions

0 votes
1 answer 120 views
120 views
Problem: how i can fix this ? any help ! error: cannot add ggproto objects together. did you forget to add this object to a ggplot object?.
asked Mar 6 Wafa Abu Yousef 6.1k points
0 votes
2 answers 267 views
267 views
Problem: Did you forget to add the following object to a ggplot object? error: cannot add ggproto objects together.
asked Feb 23 Muneeb Saadii 130k points
0 votes
1 answer 554 views
0 votes
1 answer 11 views
11 views
Problem: Where will I able to find an answer for this : Error: geomrasterann was built with an incompatible version of ggproto.?
asked Jun 17 nila 121k points
0 votes
1 answer 4 views
4 views
Problem: Please give me an answer to this : Geomrasterann was built with an incompatible version of ggproto.
asked Jun 20 Florina Gulnar 106k points
0 votes
1 answer 23 views
23 views
Problem: Need a solution for this > Error:ggplot2 doesn't know how to deal with data of class gg/ggplot
asked May 9 Aurelia Maja 78.4k points
0 votes
1 answer 214 views
214 views
Problem: ggplot error: discrete value supplied to continuous scale.
asked Feb 23 Dan phillip 4.8k points
1 vote
2 answers 143 views
143 views
Problem : I have recently started using R I am very new to R while working on R I am facing the below error whenever I try to create the graph on the ggplot: &ldquo;Error: ggplot2 doesn't know how to deal with data of class gg/ggplot&rdquo; I often face the error message if ... = Cost)) MyCars %>% ggplot() %>% geom_point(mapping = aes(x = Destination, y = Cost)) I need help in fixing above error.
asked Mar 30, 2020 morrisBson 3.2k points
0 votes
1 answer 9 views
9 views
Problem: Ggplot discrete value supplied to continuous scale
asked Jun 29 Shifa 18.2k points
0 votes
1 answer 4 views
4 views
Problem: Asked few friends but no solution, please help : Ggplot doesn't know how to deal with data of class numeric
asked Jun 23 Chi Omega 168k points