ACCLAB / dabestr

Data Analysis with Bootstrap Estimation in R
https://acclab.github.io/dabestr
Apache License 2.0
211 stars 34 forks source link

Plot Aesthetics #148

Open JJRAINE opened 9 months ago

JJRAINE commented 9 months ago

Hi,

I've run into an issue attempting to add black outlines to the swarm plot points while maintaining a color palette. My original plot* generates normally as below (Test1), however attempting to add the black outline seems to override the color palette (Test 2). Instructing it to fill with a single color works (Test 3), however I'm unable to fill with a palette. Providing multiple colors returns the 'Error in Fortify' below (Test). Any assistance would be much appreciated, thanks!

*The data for this plot and creation of the cliffs delta object is available as an attachment

Test1 <- plot(CLIFFSWT20, color.column = TIME, palette = "Reds", rawplot.markersize = 1.8, effsize.markersize = 1.5, effsize.ylim = c(-1, 1)) Test1 image

Test2 <- plot(CLIFFSWT20, swarmplot.params = list(mapping = aes(fill = TIME, color = TIME), color = "black", pch = 21, size = 3), color.column = TIME, palette = "Reds", rawplot.markersize = 1.8, effsize.markersize = 1.5, effsize.ylim = c(-1, 1)) Test2 image

Test3 <- plot(CLIFFSWT20, swarmplot.params = list(mapping = aes(fill = TIME, color = TIME), fill = "red", color = "black", pch = 21, size = 3), color.column = TIME, palette = "Reds", rawplot.markersize = 1.8, effsize.markersize = 1.5, effsize.ylim = c(-1, 1)) Test3 image

Test4 <- plot(CLIFFSWT20, swarmplot.params = list(mapping = aes(fill = TIME,), fill = "red","blue","green",color = "black", pch = 21, size = 3), color.column = TIME, rawplot.markersize = 1.8, effsize.markersize = 1.5, effsize.ylim = c(-1, 1)) Test4

Error in fortify(): ! data must be a , or an object coercible by fortify(), not the string "blue". Backtrace:

  1. base::plot(...)
  2. dabestr:::plot.dabest_effsize(...)
  3. ggbeeswarm (local) <fn>(...)
  4. ggplot2::layer(...)
  5. ggplot2:::fortify.default(data)

CSVs for R.csv CLIFFSWT20 <- dabest(CSVs_for_R, TIME, Tin, idx = unique(reodata$TIME), paired = FALSE) %>% cliffs_delta()

sunroofgod commented 6 months ago

Hi @JJRAINE ,

We've recently released a new version of dabestr, 
“Lapis” (v2023.9.12), which adds estimation graphics for four new data types: repeated measures, 2 × 2 designs, proportions, and easy meta-analyses.

dabestr version “Lapis” is a complete rebuild of the original dabestr and as such, unfortunately, v0.3.0 of dabestr and below are now deprecated and will no longer be receiving support.

We strongly recommend upgrading to the latest version (“Lapis”) as soon as possible. This will not only ensure access to the latest features but also expedite the resolution of any issues you may have encountered.

You can find the latest release here and the updated documentation for the package here.

For quick installation, you may refer to the following:

# Install it from CRAN
install.packages("dabestr")

# Or the development version from GitHub:
# install.packages("devtools")
devtools::install_github(repo = "ACCLAB/dabestr", ref = "dev")

If you face any challenges during the update process or have further questions, please don't hesitate to reach out.

We value your feedback and appreciate your continued support!