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
2 tasks
miaicosta opened this issue Feb 26, 2019 · 3 comments
Closed
2 tasks

Change point shapes in plot of AMCEs or MMs #18

miaicosta opened this issue Feb 26, 2019 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers question Further information is requested

Comments

@miaicosta
Copy link

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 leeper added question Further information is requested enhancement New feature or request labels Feb 28, 2019
@leeper
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
Copy link
Author

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

@leeper leeper added the good first issue Good for newcomers label Mar 15, 2019
@leeper
Copy link
Owner

leeper commented Apr 7, 2019

Closed by 0afd299

@leeper leeper closed this as completed Apr 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants