From 728813bb70024ac96394ecb00147fb0d9c3a4997 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Tue, 6 Apr 2021 17:17:37 +0200 Subject: [PATCH] address CRAN comments --- DESCRIPTION | 1 - R/cor_test.R | 6 +++--- R/correlation.R | 2 +- cran-comments.md | 2 ++ inst/WORDLIST | 2 +- man/cor_test.Rd | 4 ++-- man/correlation.Rd | 4 ++-- tests/testthat/test-display_print_matrix.R | 2 +- vignettes/multilevel.Rmd | 8 ++++---- vignettes/types.Rmd | 13 +++++++------ 10 files changed, 23 insertions(+), 21 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 16e24600..6e93787a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -68,6 +68,5 @@ VignetteBuilder: knitr Encoding: UTF-8 Language: en-US -LazyData: true RoxygenNote: 7.1.1.9001 Config/testthat/edition: 3 diff --git a/R/cor_test.R b/R/cor_test.R index f8d93420..455230bc 100644 --- a/R/cor_test.R +++ b/R/cor_test.R @@ -45,8 +45,8 @@ #' redundant. Nonetheless, it is an easy option to increase the robustness of the #' correlation as well as flexible way to obtain Bayesian or multilevel #' Spearman-like rank correlations. -#' @param robust Old name for \code{ranktransform}. Will be removed in subsequent -#' versions, so better to use \code{ranktransform} which is more explicit about +#' @param robust Old name for \code{ranktransform}. Will be removed in subsequent +#' versions, so better to use \code{ranktransform} which is more explicit about #' what it does. #' @param winsorize Another way of making the correlation more "robust" (i.e., #' limiting the impact of extreme values). Can be either \code{FALSE} or a @@ -138,7 +138,7 @@ cor_test <- function(data, ...) { # Deprecation warnings - if(!is.null(robust)) { + if (!is.null(robust)) { warning("The 'robust' argument is deprecated in favour of 'ranktransform' (more explicit). Please use the latter instead to remove this warning.") ranktransform <- robust } diff --git a/R/correlation.R b/R/correlation.R index 64a62359..6e3fdb22 100644 --- a/R/correlation.R +++ b/R/correlation.R @@ -252,7 +252,7 @@ correlation <- function(data, ...) { # Deprecation warnings - if(!is.null(robust)) { + if (!is.null(robust)) { warning("The 'robust' argument is deprecated in favour of 'ranktransform' (more explicit). Please use the latter instead to remove this warning.") ranktransform <- robust } diff --git a/cran-comments.md b/cran-comments.md index 3ac9d558..ddd5e547 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -7,6 +7,8 @@ 0 errors | 0 warnings | 0 note + * Fixes `NOTE`s and `WARNING`s in `R CMD CHECK` for last released version. + ## revdepcheck results We checked 4 reverse dependencies, comparing R CMD check results across CRAN and diff --git a/inst/WORDLIST b/inst/WORDLIST index 69e44f79..f668a180 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -62,6 +62,7 @@ dichotomously doi easystats et +favour favours fieller frac @@ -82,7 +83,6 @@ pracma ressembles rmarkdown semipartial -severly spearman tetrachoric th diff --git a/man/cor_test.Rd b/man/cor_test.Rd index f4fd9cb9..328823f0 100644 --- a/man/cor_test.Rd +++ b/man/cor_test.Rd @@ -82,8 +82,8 @@ redundant. Nonetheless, it is an easy option to increase the robustness of the correlation as well as flexible way to obtain Bayesian or multilevel Spearman-like rank correlations.} -\item{robust}{Old name for \code{ranktransform}. Will be removed in subsequent -versions, so better to use \code{ranktransform} which is more explicit about +\item{robust}{Old name for \code{ranktransform}. Will be removed in subsequent +versions, so better to use \code{ranktransform} which is more explicit about what it does.} \item{winsorize}{Another way of making the correlation more "robust" (i.e., diff --git a/man/correlation.Rd b/man/correlation.Rd index 805618fe..e624ab78 100644 --- a/man/correlation.Rd +++ b/man/correlation.Rd @@ -116,8 +116,8 @@ redundant. Nonetheless, it is an easy option to increase the robustness of the correlation as well as flexible way to obtain Bayesian or multilevel Spearman-like rank correlations.} -\item{robust}{Old name for \code{ranktransform}. Will be removed in subsequent -versions, so better to use \code{ranktransform} which is more explicit about +\item{robust}{Old name for \code{ranktransform}. Will be removed in subsequent +versions, so better to use \code{ranktransform} which is more explicit about what it does.} \item{winsorize}{Another way of making the correlation more "robust" (i.e., diff --git a/tests/testthat/test-display_print_matrix.R b/tests/testthat/test-display_print_matrix.R index 1be76a1f..0be0645e 100644 --- a/tests/testthat/test-display_print_matrix.R +++ b/tests/testthat/test-display_print_matrix.R @@ -1,4 +1,4 @@ -if (require("testthat") && require("gt") && require("dplyr")) { +if (require("testthat") && require("gt") && require("dplyr")) { # display and print method works - markdown ----------------------------- diff --git a/vignettes/multilevel.Rmd b/vignettes/multilevel.Rmd index 16a57dfb..efea814f 100644 --- a/vignettes/multilevel.Rmd +++ b/vignettes/multilevel.Rmd @@ -19,8 +19,9 @@ bibliography: bibliography.bib This vignette can be cited as: -Makowski, D., Ben-Shachar, M. S., Patil, I., & Lüdecke, D. (2019). Methods -and Algorithms for Correlation Analysis in R. _Journal of Open Source Software_, _5_(51), 2306. doi:10.21105/joss.02306 +```{r cite} +citation("correlation") +``` --- @@ -102,8 +103,7 @@ ggplot(data, aes(x = V1, y = V2)) + ``` Mmh, interesting. It seems like, for each subject, the relationship is -different. The negative general trend seems to be created by **differences -between the groups** and could be spurious! +different. The (global) negative trend seems to be an artifact of **differences between the groups** and could be spurious! **Multilevel *(as in multi-group)* ** correlations allow us to account for **differences between groups**. It is based on a partialization of the group, diff --git a/vignettes/types.Rmd b/vignettes/types.Rmd index 127dcd7d..aa231d3e 100644 --- a/vignettes/types.Rmd +++ b/vignettes/types.Rmd @@ -42,8 +42,9 @@ if (!requireNamespace("see", quietly = TRUE) || This vignette can be cited as: -Makowski, D., Ben-Shachar, M. S., Patil, I., & Lüdecke, D. (2019). Methods -and Algorithms for Correlation Analysis in R. _Journal of Open Source Software_, _5_(51), 2306. doi:10.21105/joss.02306 +```{r cite} +citation("correlation") +``` --- @@ -51,7 +52,7 @@ and Algorithms for Correlation Analysis in R. _Journal of Open Source Software_, Correlations tests are arguably one of the most commonly used statistical procedures, and are used as a basis in many applications such as exploratory -data analysis, structural modelling, data engineering etc. In this context, we +data analysis, structural modeling, data engineering, etc. In this context, we present **correlation**, a toolbox for the R language [@Rteam] and part of the [**easystats**](https://github.com/easystats/easystats) collection, focused on correlation analysis. Its goal is to be lightweight, easy to use, and allows for @@ -130,7 +131,7 @@ binary variable is assumed to have an underlying continuity. For example, anxiety level can be measured on a continuous scale, but can be classified dichotomously as high/low. -- **Winsorized correlation**: Correlation of variables that have been formerly +- **Winsorized correlation**: Correlation of variables that have been Winsorized, i.e., transformed by limiting extreme values to reduce the effect of possibly spurious outliers. @@ -141,7 +142,7 @@ distributed continuous latent variables, from two observed ordinal variables. applicable when both observed variables are dichotomous. - **Partial correlation**: Correlation between two variables after adjusting for -the (linear) the effect of one or more variables. The correlation test is here +the (linear) effect of one or more variables. The correlation test is run after having partialized the dataset, independently from it. In other words, it considers partialization as an independent step generating a different dataset, rather than belonging to the same model. This is why some discrepancies @@ -154,7 +155,7 @@ $$r_{xy.z} = r_{e_{x.z},e_{y.z}}$$ - **Multilevel correlation**: Multilevel correlations are a special case of partial correlations where the variable to be adjusted for is a factor and is -included as a random effect in a mixed model. +included as a random effect in a mixed-effects model. ## Comparison