diff --git a/.Rbuildignore b/.Rbuildignore index 2668cdf3..fbf9447b 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -7,6 +7,7 @@ ^CRAN-RELEASE$ ^CRAN-SUBMISSION$ ^LICENSE\.md$ +^Makefile$ ^Meta$ ^NEWS$ ^README-.*\.png$ @@ -48,4 +49,5 @@ hextools publication/* references.bib +shell tests\^spelling diff --git a/.github/workflows/lint-changed-files.yaml b/.github/workflows/lint-changed-files.yaml index d8b53464..c270947a 100644 --- a/.github/workflows/lint-changed-files.yaml +++ b/.github/workflows/lint-changed-files.yaml @@ -43,6 +43,7 @@ jobs: commented_code_linter = NULL, cyclocomp_linter(25L), extraction_operator_linter = NULL, + if_not_else_linter(exceptions = character(0L)), implicit_integer_linter = NULL, library_call_linter = NULL, line_length_linter(120L), diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 6e722645..5a137fdd 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -44,6 +44,7 @@ jobs: commented_code_linter = NULL, cyclocomp_linter(25L), extraction_operator_linter = NULL, + if_not_else_linter(exceptions = character(0L)), implicit_integer_linter = NULL, library_call_linter = NULL, line_length_linter(120L), @@ -62,3 +63,5 @@ jobs: defaults = linters_with_tags(tags = NULL) )) shell: Rscript {0} + env: + LINTR_ERROR_ON_LINT: true diff --git a/.github/workflows/styler.yaml b/.github/workflows/styler.yaml index 77cac5a9..1696fa17 100644 --- a/.github/workflows/styler.yaml +++ b/.github/workflows/styler.yaml @@ -30,6 +30,7 @@ jobs: r-lib/pkgapi r-lib/styler r-lib/roxygen2 + anthonynorth/roxyglobals needs: | styler roxygen2 diff --git a/.lintr b/.lintr index e3a82a21..843f5e62 100644 --- a/.lintr +++ b/.lintr @@ -4,6 +4,7 @@ linters: linters_with_defaults( commented_code_linter = NULL, cyclocomp_linter(25L), extraction_operator_linter = NULL, + if_not_else_linter(exceptions = character(0L)), implicit_integer_linter = NULL, library_call_linter = NULL, line_length_linter(120L), diff --git a/CITATION.cff b/CITATION.cff index 8c7df64b..3882b267 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -8,7 +8,7 @@ message: 'To cite package "statsExpressions" in publications use:' type: software license: GPL-3.0-only title: 'statsExpressions: Tidy Dataframes and Expressions with Statistical Details' -version: 1.5.2 +version: 1.5.2.9000 doi: 10.21105/joss.03236 abstract: 'Utilities for producing dataframes with rich details for the most common types of statistical approaches and tests: parametric, nonparametric, robust, and @@ -110,7 +110,7 @@ references: given-names: Jeffrey N. email: jrouder@uci.edu year: '2023' - version: '>= 0.9.12-4.4' + version: '>= 0.9.12-4.5' - type: software title: correlation abstract: 'correlation: Methods for Correlation Analysis' @@ -149,7 +149,7 @@ references: abstract: 'datawizard: Easy Data Wrangling and Statistical Transformations' notes: Imports url: https://easystats.github.io/datawizard/ - repository: https://easystats.r-universe.dev + repository: https://CRAN.R-project.org/package=datawizard authors: - family-names: Patil given-names: Indrajeet @@ -176,7 +176,7 @@ references: email: brenton@wiernik.org orcid: https://orcid.org/0000-0001-9560-6336 year: '2023' - version: '>= 0.8.0' + version: '>= 0.9.0' - type: software title: dplyr abstract: 'dplyr: A Grammar of Data Manipulation' @@ -234,7 +234,7 @@ references: email: remi.theriault@mail.mcgill.ca orcid: https://orcid.org/0000-0003-4315-6788 year: '2023' - version: '>= 0.8.5' + version: '>= 0.8.6' - type: software title: glue abstract: 'glue: Interpreted String Literals' @@ -255,7 +255,7 @@ references: abstract: 'insight: Easy Access to Model Information for Various Model Objects' notes: Imports url: https://easystats.github.io/insight/ - repository: https://CRAN.R-project.org/package=insight + repository: https://easystats.r-universe.dev authors: - family-names: Lüdecke given-names: Daniel @@ -290,7 +290,7 @@ references: email: etienne.bacher@protonmail.com orcid: https://orcid.org/0000-0002-9271-5075 year: '2023' - version: '>= 0.19.4' + version: '>= 0.19.5' - type: software title: magrittr abstract: 'magrittr: A Forward-Pipe Operator for R' @@ -369,7 +369,7 @@ references: email: brenton@wiernik.org orcid: https://orcid.org/0000-0001-9560-6336 year: '2023' - version: '>= 0.10.4' + version: '>= 0.10.5' - type: software title: PMCMRplus abstract: 'PMCMRplus: Calculate Pairwise Multiple Comparisons of Mean Rank Sums @@ -589,12 +589,12 @@ references: title: metaBMA abstract: 'metaBMA: Bayesian Model Averaging for Random and Fixed Effects Meta-Analysis' notes: Suggests - url: https://github.com/danheck/metaBMA + url: https://danheck.github.io/metaBMA/ repository: https://CRAN.R-project.org/package=metaBMA authors: - family-names: Heck given-names: Daniel W. - email: dheck@uni-marburg.de + email: daniel.heck@uni-marburg.de orcid: https://orcid.org/0000-0002-6302-9252 year: '2023' - type: software diff --git a/DESCRIPTION b/DESCRIPTION index cbfa720b..4b2c7ff3 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -26,13 +26,13 @@ Depends: R (>= 4.1.0) Imports: afex (>= 1.3-0), - BayesFactor (>= 0.9.12-4.4), + BayesFactor (>= 0.9.12-4.5), correlation (>= 0.8.4), - datawizard (>= 0.8.0), + datawizard (>= 0.9.0), dplyr (>= 1.1.3), - effectsize (>= 0.8.5), + effectsize (>= 0.8.6), glue, - insight (>= 0.19.4), + insight (>= 0.19.5), magrittr, parameters (>= 0.21.1), performance (>= 0.10.5), @@ -62,8 +62,11 @@ VignetteBuilder: Encoding: UTF-8 Language: en-US LazyData: true -Roxygen: list(markdown = TRUE, roclets = c("rd", "namespace", "collate", - "pkgapi::api_roclet")) +Roxygen: list( + markdown = TRUE, + roclets = c("collate", "namespace", "rd", "pkgapi::api_roclet", "roxyglobals::global_roclet") + ) RoxygenNote: 7.2.3.9000 Config/testthat/edition: 3 Config/testthat/parallel: true +Config/Needs/check: anthonynorth/roxyglobals diff --git a/R/add_expression_col.R b/R/add_expression_col.R index 3ea05f1e..72d0b452 100644 --- a/R/add_expression_col.R +++ b/R/add_expression_col.R @@ -47,6 +47,8 @@ #' @inheritParams oneway_anova #' @inheritParams long_to_wide_converter #' +#' @autoglobal +#' #' @examples #' set.seed(123) #' diff --git a/R/centrality_description.R b/R/centrality_description.R index 2f2a4e65..573a9b76 100644 --- a/R/centrality_description.R +++ b/R/centrality_description.R @@ -24,6 +24,8 @@ #' @inheritParams oneway_anova #' @param ... Currently ignored. #' +#' @autoglobal +#' #' @example man/examples/examples-centrality_description.R #' @export centrality_description <- function(data, diff --git a/R/contingency_table.R b/R/contingency_table.R index bd7a1dfb..22debc7d 100644 --- a/R/contingency_table.R +++ b/R/contingency_table.R @@ -47,6 +47,8 @@ #' @inheritParams stats::chisq.test #' @inheritParams oneway_anova #' +#' @autoglobal +#' #' @examplesIf identical(Sys.getenv("NOT_CRAN"), "true") #' # for reproducibility #' set.seed(123) diff --git a/R/corr_test.R b/R/corr_test.R index 01fb0b13..1ada7528 100644 --- a/R/corr_test.R +++ b/R/corr_test.R @@ -23,6 +23,8 @@ #' be plotted on the `y`-axis. #' @inheritParams oneway_anova #' +#' @autoglobal +#' #' @example man/examples/examples-corr_test.R #' @export corr_test <- function(data, diff --git a/R/global_vars.R b/R/global_vars.R deleted file mode 100644 index 9d4dfa5c..00000000 --- a/R/global_vars.R +++ /dev/null @@ -1,41 +0,0 @@ -# defining global variables and functions to appease R CMD Check - -utils::globalVariables( - names = c( - ".", - "effectsize", - "estimate", - ".rowid", - "statistic", - "std.error", - "term", - ".counts", - "nested_data", - "df", - "df.error", - "k.df", - "effsize.text", - "method", - ".f", - ".f.es", - ".f.args", - "bf10", - "conf.low", - "conf.high", - "r2.component", - "conf.level", - ".fn", - ".ns", - "p.value", - "where", - "k.df.error", - "group1", - "group2", - "log_e_bf10", - "p_adjust_text", - "n.obs", - "r.squared" - ), - package = "statsExpressions", - add = FALSE -) diff --git a/R/globals.R b/R/globals.R new file mode 100644 index 00000000..3605414c --- /dev/null +++ b/R/globals.R @@ -0,0 +1,35 @@ +# Generated by roxyglobals: do not edit by hand + +utils::globalVariables(c( + "method", # + "effectsize", # + "n.obs", # + "df", # + "n.obs", # + "estimate", # + ".counts", # + ".f", # + ".f.es", # + ".", # + "r.squared", # + ".", # + ".rowid", # + "nested_data", # + ".ns", # + ".fn", # + ".f.args", # + ".rowid", # + "k.df", # + "k.df.error", # + ".f", # + ".rowid", # + ".f", # + "group1", # + "group2", # + ".ns", # + ".fn", # + "term", # + "p.value", # + "term", # + NULL +)) diff --git a/R/helpers_easystats.R b/R/helpers_easystats.R index e89a0428..37e7a6db 100644 --- a/R/helpers_easystats.R +++ b/R/helpers_easystats.R @@ -3,6 +3,8 @@ #' #' @inheritParams parameters::model_parameters #' +#' @autoglobal +#' #' @examples #' model <- lm(mpg ~ wt + cyl, data = mtcars) #' tidy_model_parameters(model) @@ -12,7 +14,7 @@ tidy_model_parameters <- function(model, ...) { mutate(conf.method = . %@% "ci_method") %>% select(-matches("Difference")) %>% standardize_names(style = "broom") %>% - rename_all(~ gsub("cramers.", "", .x)) %>% + rename_all(~ gsub("cramers.|omega2.|eta2.", "", .x)) %>% rename_with(recode, bayes.factor = "bf10") %>% tidyr::fill(matches("^prior|^bf"), .direction = "updown") %>% mutate(across(matches("bf10"), ~ log(.x), .names = "log_e_{.col}")) @@ -46,6 +48,8 @@ tidy_model_parameters <- function(model, ...) { #' @param data A data frame returned by `{effectsize}` functions. #' @param ... Currently ignored. #' +#' @autoglobal +#' #' @examples #' df <- effectsize::cohens_d(sleep$extra, sleep$group) #' tidy_model_effectsize(df) diff --git a/R/long_to_wide_converter.R b/R/long_to_wide_converter.R index d3563bbf..968cebdb 100644 --- a/R/long_to_wide_converter.R +++ b/R/long_to_wide_converter.R @@ -37,6 +37,8 @@ #' @returns A data frame with `NA`s removed while respecting the #' between-or-within-subjects nature of the dataset. #' +#' @autoglobal +#' #' @examples #' # for reproducibility #' library(statsExpressions) diff --git a/R/meta_analysis.R b/R/meta_analysis.R index 657afed7..b9936707 100644 --- a/R/meta_analysis.R +++ b/R/meta_analysis.R @@ -36,6 +36,8 @@ #' needed package (`{metafor}`, `{metaplus}`, or `{metaBMA}`) for meta-analysis. #' If they are not available, you will be asked to install them. #' +#' @autoglobal +#' #' @examplesIf identical(Sys.getenv("NOT_CRAN"), "true") && requireNamespace("metafor", quietly = TRUE) #' # setup #' set.seed(123) diff --git a/R/one_sample_test.R b/R/one_sample_test.R index fb455aac..c2035121 100644 --- a/R/one_sample_test.R +++ b/R/one_sample_test.R @@ -29,6 +29,8 @@ #' ```{r child="man/rmd-fragments/return.Rmd"} #' ``` #' +#' @autoglobal +#' #' @example man/examples/examples-one_sample_test.R #' @export one_sample_test <- function(data, diff --git a/R/oneway_anova.R b/R/oneway_anova.R index c31c7083..945fa875 100644 --- a/R/oneway_anova.R +++ b/R/oneway_anova.R @@ -41,6 +41,8 @@ #' @param ... Additional arguments (currently ignored). #' @inheritParams stats::oneway.test #' +#' @autoglobal +#' #' @examplesIf identical(Sys.getenv("NOT_CRAN"), "true") #' # for reproducibility #' set.seed(123) diff --git a/R/pairwise_comparisons.R b/R/pairwise_comparisons.R index 0559a176..74791b1d 100644 --- a/R/pairwise_comparisons.R +++ b/R/pairwise_comparisons.R @@ -32,6 +32,8 @@ #' @references For more, see: #' #' +#' @autoglobal +#' #' @examplesIf identical(Sys.getenv("NOT_CRAN"), "true") #' # for reproducibility #' set.seed(123) diff --git a/R/switch_functions.R b/R/switch_functions.R index c98e534c..646ed57e 100644 --- a/R/switch_functions.R +++ b/R/switch_functions.R @@ -16,6 +16,8 @@ #' #' You can specify just the initial letter. #' +#' @autoglobal +#' #' @examples #' stats_type_switch("p") #' stats_type_switch("bf") diff --git a/R/tidy_model_expressions.R b/R/tidy_model_expressions.R index 3247d3bf..391fac6d 100644 --- a/R/tidy_model_expressions.R +++ b/R/tidy_model_expressions.R @@ -18,6 +18,8 @@ #' This is an **experimental** function and may change in the future. Please do #' not use it yet in your workflow. #' +#' @autoglobal +#' #' @examplesIf identical(Sys.getenv("NOT_CRAN"), "true") #' # setup #' set.seed(123) diff --git a/R/two_sample_test.R b/R/two_sample_test.R index 330ea0e0..79947688 100644 --- a/R/two_sample_test.R +++ b/R/two_sample_test.R @@ -24,9 +24,12 @@ #' ```{r child="man/rmd-fragments/return.Rmd"} #' ``` #' +#' @autoglobal +#' #' @examplesIf identical(Sys.getenv("NOT_CRAN"), "true") #' @example man/examples/examples-two_sample_test_within.R #' @example man/examples/examples-two_sample_test_between.R +#' #' @export two_sample_test <- function(data, x, diff --git a/WIP/gallery.Rmd b/WIP/gallery.Rmd index 1cf088f8..37d098c4 100644 --- a/WIP/gallery.Rmd +++ b/WIP/gallery.Rmd @@ -1,7 +1,5 @@ --- title: "Gallery of examples" -author: "Indrajeet Patil" -date: "`r Sys.Date()`" output: rmarkdown::html_vignette: fig_width: 6 diff --git a/codemeta.json b/codemeta.json index e2c06175..71cb37ad 100644 --- a/codemeta.json +++ b/codemeta.json @@ -8,7 +8,7 @@ "codeRepository": "https://github.com/IndrajeetPatil/statsExpressions", "issueTracker": "https://github.com/IndrajeetPatil/statsExpressions/issues", "license": "https://spdx.org/licenses/GPL-3.0", - "version": "1.5.2", + "version": "1.5.2.9000", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", @@ -200,7 +200,7 @@ "@type": "SoftwareApplication", "identifier": "BayesFactor", "name": "BayesFactor", - "version": ">= 0.9.12-4.4", + "version": ">= 0.9.12-4.5", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -226,7 +226,7 @@ "@type": "SoftwareApplication", "identifier": "datawizard", "name": "datawizard", - "version": ">= 0.8.0", + "version": ">= 0.9.0", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -252,7 +252,7 @@ "@type": "SoftwareApplication", "identifier": "effectsize", "name": "effectsize", - "version": ">= 0.8.5", + "version": ">= 0.8.6", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -277,7 +277,7 @@ "@type": "SoftwareApplication", "identifier": "insight", "name": "insight", - "version": ">= 0.19.4", + "version": ">= 0.19.5", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -315,7 +315,7 @@ "@type": "SoftwareApplication", "identifier": "performance", "name": "performance", - "version": ">= 0.10.4", + "version": ">= 0.10.5", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -431,7 +431,7 @@ }, "SystemRequirements": null }, - "fileSize": "4130.563KB", + "fileSize": "4129.449KB", "citation": [ { "@type": "ScholarlyArticle", diff --git a/shell/metadata.sh b/shell/metadata.sh new file mode 100644 index 00000000..d15dfcc2 --- /dev/null +++ b/shell/metadata.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# Update metadata for package +# +# To run on +# - mac: > sh .sh +# - windows: > bash .sh + +Rscript -e 'roxygen2::roxygenise()' +Rscript -e 'codemetar::write_codemeta()' +Rscript -e 'cffr::cff_write()' diff --git a/vignettes/statsExpressions.Rmd b/vignettes/statsExpressions.Rmd index 8fd5b39e..a2ef67d1 100644 --- a/vignettes/statsExpressions.Rmd +++ b/vignettes/statsExpressions.Rmd @@ -1,7 +1,5 @@ --- title: "statsExpressions: R Package for Tidy Dataframes and Expressions with Statistical Details" -author: "Indrajeet Patil" -date: "`r Sys.Date()`" output: rmarkdown::html_vignette: toc: true diff --git a/vignettes/stats_details.Rmd b/vignettes/stats_details.Rmd index 6336ec43..be0df5db 100644 --- a/vignettes/stats_details.Rmd +++ b/vignettes/stats_details.Rmd @@ -1,7 +1,5 @@ --- title: "Test and effect size details" -author: "Indrajeet Patil" -date: "`r Sys.Date()`" output: rmarkdown::html_vignette: toc: true diff --git a/vignettes/web_only/dataframe_outputs.Rmd b/vignettes/web_only/dataframe_outputs.Rmd index 9726438d..94b0bda5 100644 --- a/vignettes/web_only/dataframe_outputs.Rmd +++ b/vignettes/web_only/dataframe_outputs.Rmd @@ -1,7 +1,5 @@ --- title: "Data frame outputs" -author: "Indrajeet Patil" -date: "`r Sys.Date()`" output: rmarkdown::html_vignette: toc: true