IndrajeetPatil / ggstatsplot

Enhancing {ggplot2} plots with statistical analysis 📊📣
https://indrajeetpatil.github.io/ggstatsplot/
GNU General Public License v3.0
1.98k stars 184 forks source link

Custom hex color palette #185

Closed qalid7 closed 5 years ago

qalid7 commented 5 years ago

Hi all

This is less an issue and more of an excuse to express how COOL this package is! Really helpful!

I wonder if I can pass a custom hex c("#000000", "#000000") palette like the case in many ggplot packages.

Also, I wonder if I can use wilcox or other methods for the "between" comparisons?

Thanks a lot and really amazing work!

IndrajeetPatil commented 5 years ago

Hi,

Thanks, and glad you find it useful.

You can do all the things you have mentioned with this package. Here are examples:

set.seed(123)
library(ggstatsplot)
#> Registered S3 method overwritten by 'broom.mixed':
#>   method      from 
#>   tidy.gamlss broom
library(ggplot2)

# changing palette with custom values
ggstatsplot::ggbetweenstats(mtcars, am, wt, messages = FALSE) +
  scale_color_manual(values = c("#000000", "#000000"))
#> Scale for 'colour' is already present. Adding another scale for
#> 'colour', which will replace the existing scale.


# changing type of test

# non-parametric 
ggstatsplot::ggbetweenstats(mtcars, am, wt, type = "np", messages = FALSE) 


# robust
ggstatsplot::ggbetweenstats(mtcars, am, wt, type = "r", messages = FALSE) 


# bayes factor
ggstatsplot::ggbetweenstats(mtcars, am, wt, type = "bf", messages = FALSE) 
#> Registered S3 methods overwritten by 'car':
#>   method                          from
#>   influence.merMod                lme4
#>   cooks.distance.influence.merMod lme4
#>   dfbeta.influence.merMod         lme4
#>   dfbetas.influence.merMod        lme4

Created on 2019-03-06 by the reprex package (v0.2.1.9000)

qalid7 commented 5 years ago

Wonderful thank you so much. Sorry to be a pain but is there a way to incorporate Wilcox directly in this package?

IndrajeetPatil commented 5 years ago

What do you mean by incorporating Wilcox? I am guessing you are referring to the statistical test, the non-parametric version of a t test. If yes, it’s already included in the package and you can see it in my response.

qalid7 commented 5 years ago

Yes and thanks that's all I wanted to confirm!