Giter Club home page Giter Club logo

ggpval's People

Contributors

c-mertes avatar dbrookeuab avatar ganthark avatar martinmspedersen avatar s6juncheng avatar vyepez88 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ggpval's Issues

pval_star does not work

When I run pval_star on your example data set (actually on any data set), it throws up the error:

Error in annotation[i, ] : incorrect number of dimensions

Change to new cran checks badge URL

πŸ‘‹πŸ½ I maintain the cran checks badges. Please change to the new cran checks badge URL (e.g., https://badges.cranchecks.info/worst/dplyr.svg). Old badges at (e.g. https://cranchecks.info/badges/worst/dplyr) will be unavailable as of Jan 1st 2023.

t.test parameters

Hello!
for example:

plane_p <- add_pval(plane_p, pairs = list(c(1, 2)), test = "t.test")

How should I specify the parameters used by t.test?
I want to specify

t.test(..., alternative = "less")

Thanks very much!

use correct annotation when faceting

currently when using a facet with annotation it only uses the first one from the list.

add_pval(plt, pairs = list(c(1, 2)), annotation = list("Awesome1", "Awesome2"))

results in this figure:

image

Where Awesome2 is missing.

release

Detailed procedure: http://r-pkgs.had.co.nz/release.html

  1. devtools::check()
  2. bump version in DESCRIPTION
  3. devtools::check_win_*()
  4. devtools::check_win_devel()
  5. devtools::release_checks()
  6. devtools::check_rhub()
  7. devtools::release()

Anticipate ggplotly use and don't style text

Thanks for this package! I use {plotly} often using ggplotly(p) and was disappointed when {ggsignif} was unable to convert. Thankfully, {ggpval} has no such issue, however the styling of the text (italic 'P') does not carry over.

ggpval

I appreciate that this isn't any fault of {ggpval} but in anticipation of this use case, how about an optional argument to disable styling of the text, so that it goes through ggplotly() verbatim?

example code:
# R.version.string
# [1] "R version 3.6.1 (2019-07-05)"
# packageVersion("ggpval")
# [1] β€˜0.2.3’

library(ggplot2)
plt <- ggplot(mtcars, aes(factor(gear), mpg)) +
  geom_boxplot() + 
  geom_jitter()
p <- ggpval::add_pval(plt, pairs = list(c(1, 2)), test = "t.test")
plotly::ggplotly(p) 

strange behavior of annotation

# Create a dataframe
df <- data.frame(A = runif(5), 
                 B = runif(5), 
                 G = c("Group1", "Group2", "Group3", "Group4", "Group5")) 
# Melt the dataframe to be used for ggplot2
df_melt <- reshape2::melt(df, id.vars = "G")

# Create a list of p-values 
# Those values are the real ones that I have in my data
# I just modified them after the calculations by using case_when() with paste() as:
# (1) every p values lower than 0.001 is shown as "p < 0.001"
# (2) all the other values are shown as "p = xxx" 
# As shown on GitHub, annotation option needs a list
pvalues <- list("p < 0.001", "p < 0.001", "'p = 0.123'", "p = 0.813", "p = 0.043")

# Create the plot
library(ggplot2)
library(ggpval)
bar_plot <- ggplot(data = df_melt, aes(x = variable, y = value, fill = variable)) + geom_bar(stat = "identity", position = "dodge") +
  facet_grid(.~G)  +
  theme_bw() +
  scale_y_continuous(labels = scales::percent_format(), limits = c(0, 1.05)) 

# Add p-values
add_pval(bar_plot, pairs = list(c(1, 2)), annotation = pvalues)

Dear ggpval-team,

As you can see, Group 4 and Group 5 looks strange. Not Group 3 as I wrapped the quotations with the character string (I found that by chance as I got a parse issue 2 minutes before that part). My question is: can we avoid that extra step? Or am I doing something wrong?

EDIT: sorry, by also putting the character string for Group 4 and Group 5, it does not work for them...

Thank you for your help

Sarah

System information:
R Version: R version 4.1.1 (2021-08-10)
R Studio Version: 1.4.1717
OS: Ubuntu 20.04.3 LTS
Platform: x86_64-pc-linux-gnu (64-bit)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.