Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change point shapes in plot of AMCEs or MMs #18

Closed
miaicosta opened this Issue Feb 26, 2019 · 3 comments

Comments

Projects
None yet
2 participants
@miaicosta
Copy link

miaicosta commented Feb 26, 2019

Please specify whether your issue is about:

  • [x ] a possible bug
  • a question about package functionality
  • a suggested code or documentation change, improvement to the code, or feature request

Hi Thomas: As mentioned, I'm having trouble manually changing the shapes of points when plotting marginal means or AMCEs. Note that using scale_colour_manual() works but scale_shape_manual() is ignored.

library("cregg")

data("immigration")

mm_by <- cj(immigration, ChosenImmigrant ~ Gender + Education + LanguageSkills, id = ~CaseID, estimate = "mm", by = ~contest_no)

plot(mm_by, group = "contest_no", vline = 0.5) + scale_shape_manual(values=c(1, 2, 3, 4, 5)) + scale_colour_manual(values=c("red", "blue", "green", "purple", "black"))
@leeper

This comment has been minimized.

Copy link
Owner

leeper commented Feb 28, 2019

So this isn't a bug but we should definitely make it clearer how to do this. It requires mapping the grouping variable to shape via aes():

plot(mm_by, group = "contest_no", vline = 0.5) + 
  scale_shape_manual(values=c(1, 2, 3, 4, 5)) +
  scale_colour_manual(values=c("red", "blue", "green", "purple", "black")) + 
  aes(shape = contest_no)

tmp

@miaicosta

This comment has been minimized.

Copy link
Author

miaicosta commented Feb 28, 2019

Ah, of course - that makes sense. Thank you!

@leeper

This comment has been minimized.

Copy link
Owner

leeper commented Apr 7, 2019

Closed by 0afd299

@leeper leeper closed this Apr 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.