• Register
1 vote
2.8k 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 5 3
6,930 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 
9 7 4
38,600 points

Related questions

0 votes
1 answer 23 views
23 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 56 views
56 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 125k points
0 votes
1 answer 364 views
0 votes
1 answer 71 views
71 views
Problem: ggplot error: discrete value supplied to continuous scale.
asked Feb 23 Dan phillip 4.7k points
1 vote
2 answers 103 views
103 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 8 views
8 views
Problem : I need answer to bellow issue don't know how to automatically pick scale for object of type data.frame. defaulting to continuous.
asked Mar 14 Wafa Abu Yousef 6.1k points
0 votes
1 answer 1.5K views
1.5K views
Problem : I need answer to bellow issue don't know how to automatically pick scale for object of type data.frame. defaulting to continuous.
asked Nov 7, 2019 peterlaw 6.9k points
1 vote
1 answer 81 views
81 views
Problem: I am a naive to R. I am trying to create the bar graph using the ggplot2 to compare a type of 2016 primary election and the Bernie Sanders's respective percentage of the votes in that election. I have below code: y = $ Type : Factor w/ 2 levels ... data of class uneval. I have already tried to search the solution on above error around but because of some unknown reasons to me I am stuck.
asked May 27, 2020 Martin K 6.6k points
1 vote
1 answer 60 views
60 views
Problem : I am trying to understand R and I am very new to Programming as wel. If I try to create the box chart with the use of standard error bars I often face below error message: “Error: ggplot2 doesn't know how to deal with data of class numeric”. Looking for help in quick fixing the above error.
asked May 5, 2020 stewart 4k points
0 votes
1 answer 4 views
4 views
Problem: Please help me &hellip; how can I solve it? error in .call.graphics(c_palette, value) : invalid graphics state
asked Mar 31 Ifra 24.4k points