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

point.shape not working in interact_plot() #68

Open
ClaudiuPapasteri opened this issue Apr 18, 2023 · 0 comments
Open

point.shape not working in interact_plot() #68

ClaudiuPapasteri opened this issue Apr 18, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@ClaudiuPapasteri
Copy link

Hi. Thanks for the wonderful package. It seems that interact_plot() has an issue concerning point.shape argument. When used as intended, with point.shape = TRUE, nothing happens. Unfortunately, I couldn't find an easy fix using ggplot2 as, I am guessing, the shape_arg in interactions:::plot_mod_continuous() affects line geom and not point geom.

library(interactions) # dev version devtools::install_github("jacob-long/interactions")
library(ggplot2)

fiti <- lm(mpg ~ hp * wt, data = mtcars)

# No point shapes
interactions::interact_plot(fiti, pred = hp, modx = wt,
                            plot.points = TRUE, point.shape = TRUE, point.alpha = 0.6)

# Shape affects lines, but not points
interactions::interact_plot(fiti, pred = hp, modx = wt,
                            plot.points = TRUE, point.shape = TRUE, point.alpha = 0.6) +
geom_point(aes(shape = modx_group)) + 
scale_shape_manual(values = c(3, 16, 17))

Created on 2023-04-18 with reprex v2.0.2

@ClaudiuPapasteri ClaudiuPapasteri added the bug Something isn't working label Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant