Skip to content

Commit

Permalink
minor changes to subtitles
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrajeetPatil committed Sep 25, 2020
1 parent 8c1b5a6 commit 4e59766
Show file tree
Hide file tree
Showing 69 changed files with 438 additions and 343 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/check-full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@ jobs:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: '4.0', args: "--no-manual"}
- {os: windows-latest, r: 'release', args: "--no-manual"}
- {os: windows-latest, r: 'devel', args: "--no-manual"}
- {os: macOS-latest, r: '4.0', args: "--no-manual"}
- {os: windows-latest, r: 'oldrel', args: "--no-manual"}
- {os: macOS-latest, r: 'release', args: "--no-manual"}
#- {os: macOS-latest, r: 'devel', args: "--no-manual"}
- {os: ubuntu-16.04, r: '4.0', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest", args: "--no-manual"}
- {os: macOS-latest, r: 'oldrel', args: "--no-manual"}
- {os: ubuntu-16.04, r: 'release', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest", args: "--no-manual"}
- {os: ubuntu-16.04, r: 'devel', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest", args: "--no-manual"}
#- {os: ubuntu-16.04, r: 'oldrel', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest", args: "--no-manual"}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
Expand Down
8 changes: 5 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: statsExpressions
Title: Expressions with Statistical Details
Version: 0.5.0.9000
Version: 0.5.1
Authors@R:
person(given = "Indrajeet",
family = "Patil",
Expand All @@ -24,7 +24,7 @@ Depends:
R (>= 3.6.0)
Imports:
broomExtra,
correlation,
correlation (>= 0.4.0),
dplyr,
effectsize,
ez,
Expand All @@ -34,7 +34,7 @@ Imports:
rcompanion,
rlang,
stats,
tidyBF (>= 0.3.0),
tidyBF,
tidyr,
WRS2
Suggests:
Expand All @@ -43,6 +43,8 @@ Suggests:
rmarkdown,
spelling,
testthat
Remotes:
easystats/correlation
VignetteBuilder:
knitr
Encoding: UTF-8
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ importFrom(ipmisc,"%<-%")
importFrom(ipmisc,"%<>%")
importFrom(ipmisc,"%>%")
importFrom(ipmisc,as_tibble)
importFrom(ipmisc,easystats_to_tidy_names)
importFrom(ipmisc,long_to_wide_converter)
importFrom(ipmisc,set_cwd)
importFrom(ipmisc,signif_column)
Expand Down
11 changes: 11 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
# statsExpressions 0.5.0.9000

MINOR CHANGES

- Adapts tests to changes made in the `correlation` package.

- Subtitles for correlation tests make clear the type of statistic.

# statsExpressions 0.5.0

MINOR CHANGES

- Adapts to changes made in `tidyBF` package.

- Re-exports `correlation::correlation` needed for `ggstatsplot`.

- The `expr_t_nonparametric` subtitle now clarifies whether it's a Wilcoxon
test or a Mann-Whitney test.

# statsExpressions 0.4.2

Expand Down
14 changes: 6 additions & 8 deletions R/helpers_corr_test_expressions.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@
#' Corresponding abbreviations are also accepted: `"p"` (for
#' parametric/pearson), `"np"` (nonparametric/spearman), `"r"` (robust),
#' `"bf"` (for bayes factor), resp.
#' @param beta bending constant (Default: `0.1`). For more, see `?WRS2::pbcor`.
#' @param beta bending constant (Default: `0.1`). For more, see [WRS2::pbcor()].
#' @inheritParams tidyBF::bf_corr_test
#' @inheritParams expr_anova_parametric
#' @inheritParams expr_anova_nonparametric
#'
#' @importFrom dplyr select rename_all recode
#' @importFrom correlation correlation
#' @importFrom broomExtra easystats_to_tidy_names
#' @importFrom ipmisc stats_type_switch
#' @importFrom ipmisc easystats_to_tidy_names stats_type_switch
#'
#' @examples
#'
Expand Down Expand Up @@ -88,10 +87,9 @@ expr_corr_test <- function(data,
correlation::correlation(
data = dplyr::select(.data = data, {{ x }}, {{ y }}),
method = corr.method,
ci = conf.level,
beta = beta
ci = conf.level
) %>%
broomExtra::easystats_to_tidy_names(.) %>%
ipmisc::easystats_to_tidy_names(.) %>%
dplyr::rename_all(.tbl = ., .funs = dplyr::recode, "df" = "parameter")

# effect size dataframe is the same one
Expand All @@ -103,7 +101,7 @@ expr_corr_test <- function(data,
# preparing other needed objects
if (stats_type == "parametric") {
no.parameters <- 1L
statistic.text <- quote(italic("t"))
statistic.text <- quote(italic("t")["Student"])
effsize.text <- quote(widehat(italic("r"))["Pearson"])
}

Expand All @@ -116,7 +114,7 @@ expr_corr_test <- function(data,

if (stats_type == "robust") {
no.parameters <- 1L
statistic.text <- quote(italic("t"))
statistic.text <- quote(italic("t")["Student"])
effsize.text <- quote(widehat(italic(rho))["pb"])
}

Expand Down
2 changes: 1 addition & 1 deletion R/helpers_t_onesample_expressions.R
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ expr_t_onesample <- function(data,
# running Bayesian one-sample t-test
if (stats.type == "bayes") {
subtitle <-
tidyBF::bf_one_sample_ttest(
tidyBF::bf_ttest(
data = data,
x = {{ x }},
test.value = test.value,
Expand Down
2 changes: 1 addition & 1 deletion R/helpers_t_test_expressions.R
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ expr_t_nonparametric <- function(data,
sample_size <- nrow(data)
n.text <- quote(italic("n")["obs"])
.f <- rcompanion::wilcoxonR
statistic.text <- quote("log"["e"](italic("W")["Wilcoxon"]))
statistic.text <- quote("log"["e"](italic("W")["Mann-Whitney"]))
}

# setting up the test and getting its summary
Expand Down
27 changes: 25 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ ggDot(heightweight, aes(sex, heightIn, fill = sex),
binwidth = 0.4
) +
labs(
title = "Wilcoxon two-sample test",
title = "Mann-Whitney test",
subtitle = expr_t_nonparametric(heightweight, sex, heightIn, type = "np")
)
```
Expand Down Expand Up @@ -369,7 +369,7 @@ set.seed(123)
library(ggplot2)
library(statsExpressions)
# create a ridgeplot
# create a scatter plot
ggplot(mtcars, aes(mpg, wt)) +
geom_point() +
geom_smooth(method = "lm") +
Expand All @@ -379,6 +379,29 @@ ggplot(mtcars, aes(mpg, wt)) +
)
```

Another example

```{r corr2}
# setup
set.seed(123)
library(ggplot2)
library(ggExtra)
library(statsExpressions)
# basic plot
p <-
ggplot(mtcars, aes(mpg, wt)) +
geom_point() +
geom_smooth(method = "lm") +
labs(
title = "Pearson's correlation coefficient",
subtitle = expr_corr_test(mtcars, mpg, wt, type = "parametric")
)
# add
ggMarginal(p, type = "histogram", xparams = list(binwidth = 1, fill = "orange"))
```

## Example: Expressions for contingency table analysis

For categorical/nominal data - one-sample:
Expand Down
33 changes: 29 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [![CRAN_Release_Badge](http://www.r-pkg.org/badges/version-ago/statsExpressions)](https://CRAN.R-project.org/package=statsExpressions) | [![Build Status](https://travis-ci.org/IndrajeetPatil/statsExpressions.svg?branch=master)](https://travis-ci.org/IndrajeetPatil/statsExpressions) | [![Daily downloads badge](https://cranlogs.r-pkg.org/badges/last-day/statsExpressions?color=blue)](https://CRAN.R-project.org/package=statsExpressions) | [![GitHub version](https://img.shields.io/badge/GitHub-0.4.3-orange.svg?style=flat-square)](https://github.com/IndrajeetPatil/statsExpressions/) | [![Website](https://img.shields.io/badge/website-statsExpressions-orange.svg?colorB=E91E63)](https://indrajeetpatil.github.io/statsExpressions/) |
| [![CRAN Checks](https://cranchecks.info/badges/summary/statsExpressions)](https://cran.r-project.org/web/checks/check_results_statsExpressions.html) | [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/IndrajeetPatil/statsExpressions?branch=master&svg=true)](https://ci.appveyor.com/project/IndrajeetPatil/statsExpressions) | [![Weekly downloads badge](https://cranlogs.r-pkg.org/badges/last-week/statsExpressions?color=blue)](https://CRAN.R-project.org/package=statsExpressions) | [![Forks](https://img.shields.io/badge/forks-8-blue.svg)](https://github.com/IndrajeetPatil/statsExpressions/) | [![Features](https://img.shields.io/badge/features-statsExpressions-orange.svg?colorB=2196F3)](https://indrajeetpatil.github.io/statsExpressions/reference/index.html) |
| [![minimal R version](https://img.shields.io/badge/R%3E%3D-3.6.0-6666ff.svg)](https://cran.r-project.org/) | [![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/) | [![Monthly downloads badge](https://cranlogs.r-pkg.org/badges/last-month/statsExpressions?color=blue)](https://CRAN.R-project.org/package=statsExpressions) | [![Github Issues](https://img.shields.io/badge/issues-6-red.svg)](https://github.com/IndrajeetPatil/statsExpressions/issues) | [![vignettes](https://img.shields.io/badge/vignettes-0.4.3-orange.svg?colorB=FF5722)](https://CRAN.R-project.org/package=statsExpressions/vignettes/) |
| [![minimal R version](https://img.shields.io/badge/R%3E%3D-3.6.0-6666ff.svg)](https://cran.r-project.org/) | [![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/) | [![Monthly downloads badge](https://cranlogs.r-pkg.org/badges/last-month/statsExpressions?color=blue)](https://CRAN.R-project.org/package=statsExpressions) | [![Github Issues](https://img.shields.io/badge/issues-5-red.svg)](https://github.com/IndrajeetPatil/statsExpressions/issues) | [![vignettes](https://img.shields.io/badge/vignettes-0.4.3-orange.svg?colorB=FF5722)](https://CRAN.R-project.org/package=statsExpressions/vignettes/) |
| [![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/IndrajeetPatil/statsExpressions.svg)](https://github.com/IndrajeetPatil/statsExpressions) | [![Coverage Status](https://coveralls.io/repos/github/IndrajeetPatil/statsExpressions/badge.svg?branch=master)](https://coveralls.io/github/IndrajeetPatil/statsExpressions?branch=master) | [![Total downloads badge](https://cranlogs.r-pkg.org/badges/grand-total/statsExpressions?color=blue)](https://CRAN.R-project.org/package=statsExpressions) | [![Github Stars](https://img.shields.io/github/stars/IndrajeetPatil/statsExpressions.svg?style=social&label=Github)](https://github.com/IndrajeetPatil/statsExpressions) | [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.2074621.svg)](https://doi.org/10.5281/zenodo.3386122) |
| [![Licence](https://img.shields.io/badge/licence-GPL--3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html) | [![Codecov test coverage](https://codecov.io/gh/IndrajeetPatil/statsExpressions/branch/master/graph/badge.svg)](https://codecov.io/gh/IndrajeetPatil/statsExpressions?branch=master) | [![Covrpage Summary](https://img.shields.io/badge/covrpage-Last_Build_2020_03_22-yellowgreen.svg)](https://github.com/IndrajeetPatil/statsExpressions/blob/master/tests/README.md) | [![Last-changedate](https://img.shields.io/badge/last%20change-2020--09--16-yellowgreen.svg)](https://github.com/IndrajeetPatil/statsExpressions/commits/master) | [![GitHub last commit](https://img.shields.io/github/last-commit/IndrajeetPatil/statsExpressions.svg)](https://github.com/IndrajeetPatil/statsExpressions/commits/master) |
| [![Licence](https://img.shields.io/badge/licence-GPL--3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html) | [![Codecov test coverage](https://codecov.io/gh/IndrajeetPatil/statsExpressions/branch/master/graph/badge.svg)](https://codecov.io/gh/IndrajeetPatil/statsExpressions?branch=master) | [![Covrpage Summary](https://img.shields.io/badge/covrpage-Last_Build_2020_03_22-yellowgreen.svg)](https://github.com/IndrajeetPatil/statsExpressions/blob/master/tests/README.md) | [![Last-changedate](https://img.shields.io/badge/last%20change-2020--09--24-yellowgreen.svg)](https://github.com/IndrajeetPatil/statsExpressions/commits/master) | [![GitHub last commit](https://img.shields.io/github/last-commit/IndrajeetPatil/statsExpressions.svg)](https://github.com/IndrajeetPatil/statsExpressions/commits/master) |
| [![status](https://tinyverse.netlify.com/badge/statsExpressions)](https://CRAN.R-project.org/package=statsExpressions) | [![R build status](https://github.com/IndrajeetPatil/statsExpressions/workflows/R-CMD-check/badge.svg)](https://github.com/IndrajeetPatil/statsExpressions) | [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/statsExpressions/community) | [![Project Status](http://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) | [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/IndrajeetPatil/statsExpressions/issues) |

Introduction <img src="man/figures/logo.png" align="right" width="240" />
Expand Down Expand Up @@ -314,7 +314,7 @@ ggDot(heightweight, aes(sex, heightIn, fill = sex),
binwidth = 0.4
) +
labs(
title = "Wilcoxon two-sample test",
title = "Mann-Whitney test",
subtitle = expr_t_nonparametric(heightweight, sex, heightIn, type = "np")
)
```
Expand Down Expand Up @@ -384,7 +384,7 @@ set.seed(123)
library(ggplot2)
library(statsExpressions)

# create a ridgeplot
# create a scatter plot
ggplot(mtcars, aes(mpg, wt)) +
geom_point() +
geom_smooth(method = "lm") +
Expand All @@ -396,6 +396,31 @@ ggplot(mtcars, aes(mpg, wt)) +

<img src="man/figures/README-corr-1.png" width="100%" />

Another example

``` r
# setup
set.seed(123)
library(ggplot2)
library(ggExtra)
library(statsExpressions)

# basic plot
p <-
ggplot(mtcars, aes(mpg, wt)) +
geom_point() +
geom_smooth(method = "lm") +
labs(
title = "Pearson's correlation coefficient",
subtitle = expr_corr_test(mtcars, mpg, wt, type = "parametric")
)

# add
ggMarginal(p, type = "histogram", xparams = list(binwidth = 1, fill = "orange"))
```

<img src="man/figures/README-corr2-1.png" width="100%" />

Example: Expressions for contingency table analysis
---------------------------------------------------

Expand Down
8 changes: 4 additions & 4 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
],
"issueTracker": "\n https://github.com/IndrajeetPatil/statsExpressions/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.5.0.9000",
"version": "0.5.1",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down Expand Up @@ -137,13 +137,14 @@
"@type": "SoftwareApplication",
"identifier": "correlation",
"name": "correlation",
"version": ">= 0.4.0",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=correlation"
"sameAs": "https://github.com/easystats/correlation"
},
{
"@type": "SoftwareApplication",
Expand Down Expand Up @@ -250,7 +251,6 @@
"@type": "SoftwareApplication",
"identifier": "tidyBF",
"name": "tidyBF",
"version": ">= 0.3.0",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
Expand Down Expand Up @@ -333,6 +333,6 @@
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"fileSize": "3808.376KB",
"fileSize": "3907.52KB",
"readme": "https://github.com/IndrajeetPatil/statsExpressions/blob/master/README.md"
}
2 changes: 1 addition & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

0 errors | 0 warnings | 0 note

- Maintenance release.
- Fixes failing tests with the new release of the `correlation` package.
2 changes: 1 addition & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/CODE_OF_CONDUCT.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/SUPPORT.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

3 comments on commit 4e59766

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R/helpers_anova_expressions.R:84:1: style: functions should have cyclomatic complexity of less than 15, this has 17.

expr_anova_parametric <- function(data,
^

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R/helpers_anova_expressions.R:84:1: style: functions should have cyclomatic complexity of less than 15, this has 17.

expr_anova_parametric <- function(data,
^

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R/helpers_anova_expressions.R:84:1: style: functions should have cyclomatic complexity of less than 15, this has 17.

expr_anova_parametric <- function(data,
^

Please sign in to comment.