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

Alpha error #2

Closed
shellyc26 opened this issue Apr 11, 2017 · 4 comments
Closed

Alpha error #2

shellyc26 opened this issue Apr 11, 2017 · 4 comments

Comments

@shellyc26
Copy link

I'm really looking forward to using this package more, but I can quite figure out this issue...

ggplot(iris, aes(x=Species, y=Sepal.Length)) + 
  geom_boxplot() +
  geom_signif(comparisons = list(c("versicolor", "virginica")), 
          map_signif_level=TRUE)

...gives me the error:
Error in alpha(data$colour, data$alpha) : Data must either be a data frame or a matrix

Any ideas on why this might be? Thanks!

@shellyc26
Copy link
Author

Actually, I just realized that it was because I had the "psych" package loaded. It works once I detach the psych package!

Is there any way to get around this, though? I almost always use this package, and having to detach it every time I plot is a bit irritating. Any ideas?

@const-ae
Copy link
Owner

Hey, thanks for raising the issue.

You are right when the psych packages is loaded, it loads a new alpha() function. Internally I was calling alpha(), but forgot to specify that I want the scales::alpha() and not just which ever was loaded last.

I fixed the issue and you should now, after reinstalling the package from github, be able to use package without problems:

devtools::install_github("Artjom-Metro/ggsignif")

I will try to update the CRAN version as soon as possible so other users are not affected as well.

@shellyc26
Copy link
Author

Awesome, thank you! This is a fantastic idea for a package!

I have another question (and can put it in a separate thread if you'd like). Is there any way to make the horizontal line/line tips a different linetype? For example, if I wanted a dashed horizontal line? I kept trying to pass the linetype = 2 to various plot layers (including the base layer), but that didn't work. Other aesthetics like color (changes color of both the line and the annotation) and size (changes size of annotation only) worked just fine. Any suggestions?

I think having the option for dashed lines might be useful, especially for making figures for publications that require black and white images (or those that make you pay for color images). Thanks again!

@const-ae
Copy link
Owner

Great, that it worked for you.

The second point you raise sounds also like something that should reasonably work, but please open a new issue so this stuff is kept separated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants