Skip to content

Commit

Permalink
CRAN Release candidate 0.9.2 (#756)
Browse files Browse the repository at this point in the history
* CRAN Release candidate 0.9.2

* correct URL

* fix more CRAN issues

* Update .gitignore

* another attempt

* vomit; needs a hotfix when parameters on cran

* Update test-ggcoefstats.R
  • Loading branch information
IndrajeetPatil authored May 26, 2022
1 parent 4c0c3f3 commit a36eb52
Show file tree
Hide file tree
Showing 31 changed files with 155 additions and 123 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ revdep/library.noindex
revdep/data.sqlite
/doc/
/Meta/
CRAN-SUBMISSION
7 changes: 2 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: ggstatsplot
Title: 'ggplot2' Based Plots with Statistical Details
Version: 0.9.1.9000
Version: 0.9.2
Authors@R:
person(given = "Indrajeet",
family = "Patil",
Expand Down Expand Up @@ -39,12 +39,9 @@ Imports:
purrr,
rlang,
stats,
statsExpressions (>= 1.3.1.9000),
statsExpressions (>= 1.3.2),
tidyr,
utils
Remotes:
easystats/parameters,
IndrajeetPatil/statsExpressions
Suggests:
afex,
BayesFactor (>= 0.9.12-4.3),
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ggstatsplot 0.9.1.9000
# ggstatsplot 0.9.2

N.B. All statistical analysis in `{ggstatsplot}` is carried out in
`{statsExpressions}`. Thus, to see changes related to statistical expressions,
Expand Down
2 changes: 1 addition & 1 deletion R/extract_stats.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#' This is a convenience function to extract data frames with statistical details
#' that are used to create expressions displayed in `{ggstatsplot}` plots as
#' subtitle, caption, etc. Note that all of this analysis is carried out by
#' the `{statsExpressions}` [package](https://indrajeetpatil.github.io/statsExpressions).
#' the `{statsExpressions}` [package](https://indrajeetpatil.github.io/statsExpressions/).
#'
#' The only exception is the `ggcorrmat()` function. But, if a data frame is
#' what you want, you shouldn't be using `ggcorrmat()` anyway. You can use
Expand Down
13 changes: 8 additions & 5 deletions R/ggcoefstats.R
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,15 @@ ggcoefstats <- function(x,

# sorting -------------------------

# whether the terms need to be sorted in specified order
tidy_df %<>% parameters::sort_parameters(sort = sort, column = "estimate")
if (utils::packageVersion("parameters") >= "0.17.1" && requireNamespace("parameters")) {

# `term` needs to be a factor column; otherwise, ggplot2 will sort the x-axis
# labels alphabetically and terms won't appear in the expected order
tidy_df %<>% dplyr::mutate(term = factor(term, tidy_df$term))
# whether the terms need to be sorted in specified order
tidy_df %<>% sort_parameters(sort = sort, column = "estimate")

# `term` needs to be a factor column; otherwise, ggplot2 will sort the x-axis
# labels alphabetically and terms won't appear in the expected order
tidy_df %<>% dplyr::mutate(term = factor(term, tidy_df$term))
}

# summary caption -------------------------

Expand Down
3 changes: 2 additions & 1 deletion R/global_vars.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ utils::globalVariables(
".f",
".fn",
".ns",
"log_e_bf10"
"log_e_bf10",
"sort_parameters"
),
package = "ggstatsplot",
add = FALSE
Expand Down
12 changes: 4 additions & 8 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ options(
knitr::opts_chunk$set(
collapse = TRUE,
dpi = 300, ## change to 300 once on CRAN
dpi = 150, ## change to 300 once on CRAN
warning = FALSE,
message = FALSE,
out.width = "100%",
Expand Down Expand Up @@ -298,8 +298,7 @@ ggwithinstats(
data = WineTasting,
x = Wine,
y = Taste,
title = "Wine tasting",
ggtheme = hrbrthemes::theme_ipsum_es()
title = "Wine tasting"
)
```

Expand Down Expand Up @@ -413,16 +412,14 @@ significantly different from a specified value with a one-sample test,
`gghistostats` can be used.

```{r gghistostats1, fig.width=8}
set.seed(123)
gghistostats(
data = ggplot2::msleep,
x = awake,
title = "Amount of time spent awake",
test.value = 12,
binwidth = 1,
ggtheme = hrbrthemes::theme_ipsum_tw()
binwidth = 1
)
```

Expand Down Expand Up @@ -834,7 +831,6 @@ ggbarstats(
title = "MPAA Ratings by Genre",
xlab = "movie genre",
legend.title = "MPAA rating",
ggtheme = hrbrthemes::theme_ipsum_pub(),
ggplot.component = list(ggplot2::scale_x_discrete(guide = ggplot2::guide_axis(n.dodge = 2))),
palette = "Set2"
)
Expand Down Expand Up @@ -948,7 +944,7 @@ set.seed(123)
## model
mod <- stats::lm(formula = mpg ~ am * cyl, data = mtcars)
ggcoefstats(mod, ggtheme = hrbrthemes::theme_ipsum_ps())
ggcoefstats(mod)
```

**Defaults** return<br>
Expand Down
Loading

0 comments on commit a36eb52

Please sign in to comment.