From f3da4b4ba315535fa4ca90b2e377afd865c4259d Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 13 May 2024 07:36:09 +0200 Subject: [PATCH] docs, fix --- R/mann_whitney_test.R | 15 ++++++++------- R/wilcoxon_test.R | 2 +- man/chi_squared_test.Rd | 14 ++++++++------ man/kruskal_wallis_test.Rd | 14 ++++++++------ man/mann_whitney_test.Rd | 14 ++++++++------ man/t_test.Rd | 14 ++++++++------ man/wilcoxon_test.Rd | 16 +++++++++------- 7 files changed, 50 insertions(+), 39 deletions(-) diff --git a/R/mann_whitney_test.R b/R/mann_whitney_test.R index 2a89e78d..b858918b 100644 --- a/R/mann_whitney_test.R +++ b/R/mann_whitney_test.R @@ -16,15 +16,16 @@ #' @param select Name(s) of the continuous variable(s) (as character vector) #' to be used as samples for the test. `select` can be one of the following: #' -#' - `select` specifies **one** variable and `by` is provided to indicate the -#' groups of comparison. In this case, the samples in `select` are split by -#' the groups in `by`. +#' - `select` can be used in combination with `by`, in which case `select` is +#' the name of the continous variable (and `by` indicates a grouping factor). +#' - `select` can also be a character vector of length two or more (more than +#' two names only apply to `kruskal_wallis_test()`), in which case the two +#' continuous variables are treated as samples to be compared. `by` must be +#' `NULL` in this case. +#' - If `select` select is of length **two** and `paired = TRUE`, the two samples +#' are considered as *dependent* and a paired test is carried out. #' - If `select` specifies **one** variable and `by = NULL`, a one-sample test #' is carried out (only applicable for `t_test()` and `wilcoxon_test()`). -#' - If `select` specifies **two** variables and `by` is `NULL`, the two -#' samples are compared. In combination with `paired`, a paired test is -#' carried out, i.e. samples are considered as *dependent*. -#' #' @param by Name of the variable indicating the groups. Required if `select` #' specifies only one variable that contains all samples to be compared in the #' test. If `by` is not a factor, it will be coerced to a factor. For diff --git a/R/wilcoxon_test.R b/R/wilcoxon_test.R index 92c59a00..da00f9b7 100644 --- a/R/wilcoxon_test.R +++ b/R/wilcoxon_test.R @@ -25,7 +25,7 @@ #' # one-sample test #' wilcoxon_test(mtcars, "mpg") #' # base R equivalent -#' suppressWarning(wilcox.test(mtcars$mpg ~ 1)) +#' suppressWarnings(wilcox.test(mtcars$mpg ~ 1)) #' #' # paired test #' wilcoxon_test(mtcars, c("mpg", "hp")) diff --git a/man/chi_squared_test.Rd b/man/chi_squared_test.Rd index 272110e2..cc11aa83 100644 --- a/man/chi_squared_test.Rd +++ b/man/chi_squared_test.Rd @@ -20,14 +20,16 @@ chi_squared_test( \item{select}{Name(s) of the continuous variable(s) (as character vector) to be used as samples for the test. \code{select} can be one of the following: \itemize{ -\item \code{select} specifies \strong{one} variable and \code{by} is provided to indicate the -groups of comparison. In this case, the samples in \code{select} are split by -the groups in \code{by}. +\item \code{select} can be used in combination with \code{by}, in which case \code{select} is +the name of the continous variable (and \code{by} indicates a grouping factor). +\item \code{select} can also be a character vector of length two or more (more than +two names only apply to \code{kruskal_wallis_test()}), in which case the two +continuous variables are treated as samples to be compared. \code{by} must be +\code{NULL} in this case. +\item If \code{select} select is of length \strong{two} and \code{paired = TRUE}, the two samples +are considered as \emph{dependent} and a paired test is carried out. \item If \code{select} specifies \strong{one} variable and \code{by = NULL}, a one-sample test is carried out (only applicable for \code{t_test()} and \code{wilcoxon_test()}). -\item If \code{select} specifies \strong{two} variables and \code{by} is \code{NULL}, the two -samples are compared. In combination with \code{paired}, a paired test is -carried out, i.e. samples are considered as \emph{dependent}. }} \item{by}{Name of the variable indicating the groups. Required if \code{select} diff --git a/man/kruskal_wallis_test.Rd b/man/kruskal_wallis_test.Rd index 7406d646..2f7b6790 100644 --- a/man/kruskal_wallis_test.Rd +++ b/man/kruskal_wallis_test.Rd @@ -12,14 +12,16 @@ kruskal_wallis_test(data, select = NULL, by = NULL, weights = NULL) \item{select}{Name(s) of the continuous variable(s) (as character vector) to be used as samples for the test. \code{select} can be one of the following: \itemize{ -\item \code{select} specifies \strong{one} variable and \code{by} is provided to indicate the -groups of comparison. In this case, the samples in \code{select} are split by -the groups in \code{by}. +\item \code{select} can be used in combination with \code{by}, in which case \code{select} is +the name of the continous variable (and \code{by} indicates a grouping factor). +\item \code{select} can also be a character vector of length two or more (more than +two names only apply to \code{kruskal_wallis_test()}), in which case the two +continuous variables are treated as samples to be compared. \code{by} must be +\code{NULL} in this case. +\item If \code{select} select is of length \strong{two} and \code{paired = TRUE}, the two samples +are considered as \emph{dependent} and a paired test is carried out. \item If \code{select} specifies \strong{one} variable and \code{by = NULL}, a one-sample test is carried out (only applicable for \code{t_test()} and \code{wilcoxon_test()}). -\item If \code{select} specifies \strong{two} variables and \code{by} is \code{NULL}, the two -samples are compared. In combination with \code{paired}, a paired test is -carried out, i.e. samples are considered as \emph{dependent}. }} \item{by}{Name of the variable indicating the groups. Required if \code{select} diff --git a/man/mann_whitney_test.Rd b/man/mann_whitney_test.Rd index 7e926145..be90ae7d 100644 --- a/man/mann_whitney_test.Rd +++ b/man/mann_whitney_test.Rd @@ -20,14 +20,16 @@ mann_whitney_test( \item{select}{Name(s) of the continuous variable(s) (as character vector) to be used as samples for the test. \code{select} can be one of the following: \itemize{ -\item \code{select} specifies \strong{one} variable and \code{by} is provided to indicate the -groups of comparison. In this case, the samples in \code{select} are split by -the groups in \code{by}. +\item \code{select} can be used in combination with \code{by}, in which case \code{select} is +the name of the continous variable (and \code{by} indicates a grouping factor). +\item \code{select} can also be a character vector of length two or more (more than +two names only apply to \code{kruskal_wallis_test()}), in which case the two +continuous variables are treated as samples to be compared. \code{by} must be +\code{NULL} in this case. +\item If \code{select} select is of length \strong{two} and \code{paired = TRUE}, the two samples +are considered as \emph{dependent} and a paired test is carried out. \item If \code{select} specifies \strong{one} variable and \code{by = NULL}, a one-sample test is carried out (only applicable for \code{t_test()} and \code{wilcoxon_test()}). -\item If \code{select} specifies \strong{two} variables and \code{by} is \code{NULL}, the two -samples are compared. In combination with \code{paired}, a paired test is -carried out, i.e. samples are considered as \emph{dependent}. }} \item{by}{Name of the variable indicating the groups. Required if \code{select} diff --git a/man/t_test.Rd b/man/t_test.Rd index d14e4f72..085896fe 100644 --- a/man/t_test.Rd +++ b/man/t_test.Rd @@ -20,14 +20,16 @@ t_test( \item{select}{Name(s) of the continuous variable(s) (as character vector) to be used as samples for the test. \code{select} can be one of the following: \itemize{ -\item \code{select} specifies \strong{one} variable and \code{by} is provided to indicate the -groups of comparison. In this case, the samples in \code{select} are split by -the groups in \code{by}. +\item \code{select} can be used in combination with \code{by}, in which case \code{select} is +the name of the continous variable (and \code{by} indicates a grouping factor). +\item \code{select} can also be a character vector of length two or more (more than +two names only apply to \code{kruskal_wallis_test()}), in which case the two +continuous variables are treated as samples to be compared. \code{by} must be +\code{NULL} in this case. +\item If \code{select} select is of length \strong{two} and \code{paired = TRUE}, the two samples +are considered as \emph{dependent} and a paired test is carried out. \item If \code{select} specifies \strong{one} variable and \code{by = NULL}, a one-sample test is carried out (only applicable for \code{t_test()} and \code{wilcoxon_test()}). -\item If \code{select} specifies \strong{two} variables and \code{by} is \code{NULL}, the two -samples are compared. In combination with \code{paired}, a paired test is -carried out, i.e. samples are considered as \emph{dependent}. }} \item{by}{Name of the variable indicating the groups. Required if \code{select} diff --git a/man/wilcoxon_test.Rd b/man/wilcoxon_test.Rd index 2e2e35a2..dacf41d7 100644 --- a/man/wilcoxon_test.Rd +++ b/man/wilcoxon_test.Rd @@ -20,14 +20,16 @@ wilcoxon_test( \item{select}{Name(s) of the continuous variable(s) (as character vector) to be used as samples for the test. \code{select} can be one of the following: \itemize{ -\item \code{select} specifies \strong{one} variable and \code{by} is provided to indicate the -groups of comparison. In this case, the samples in \code{select} are split by -the groups in \code{by}. +\item \code{select} can be used in combination with \code{by}, in which case \code{select} is +the name of the continous variable (and \code{by} indicates a grouping factor). +\item \code{select} can also be a character vector of length two or more (more than +two names only apply to \code{kruskal_wallis_test()}), in which case the two +continuous variables are treated as samples to be compared. \code{by} must be +\code{NULL} in this case. +\item If \code{select} select is of length \strong{two} and \code{paired = TRUE}, the two samples +are considered as \emph{dependent} and a paired test is carried out. \item If \code{select} specifies \strong{one} variable and \code{by = NULL}, a one-sample test is carried out (only applicable for \code{t_test()} and \code{wilcoxon_test()}). -\item If \code{select} specifies \strong{two} variables and \code{by} is \code{NULL}, the two -samples are compared. In combination with \code{paired}, a paired test is -carried out, i.e. samples are considered as \emph{dependent}. }} \item{by}{Name of the variable indicating the groups. Required if \code{select} @@ -72,7 +74,7 @@ data(mtcars) # one-sample test wilcoxon_test(mtcars, "mpg") # base R equivalent -suppressWarning(wilcox.test(mtcars$mpg ~ 1)) +suppressWarnings(wilcox.test(mtcars$mpg ~ 1)) # paired test wilcoxon_test(mtcars, c("mpg", "hp"))