1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/format_standardize.R
\name{format_standardize}
\alias{format_standardize}
\title{Format a Standardized Vector}
\usage{
format_standardize(
x,
reference = x,
robust = FALSE,
digits = 1,
protect_integers = TRUE,
...
)
}
\arguments{
\item{x}{A standardized numeric vector.}
\item{reference}{The reference vector from which to compute the mean and SD.}
\item{robust}{Logical, if \code{TRUE}, centering is done by subtracting the
median from the variables and dividing it by the median absolute deviation
(MAD). If \code{FALSE}, variables are standardized by subtracting the
mean and dividing it by the standard deviation (SD).}
\item{digits}{Number of digits for rounding or significant figures. May also
be \code{"signif"} to return significant figures or \code{"scientific"}
to return scientific notation. Control the number of digits by adding the
value as suffix, e.g. \code{digits = "scientific4"} to have scientific
notation with 4 decimal places, or \code{digits = "signif5"} for 5
significant figures (see also \code{\link[=signif]{signif()}}).}
\item{protect_integers}{Should integers be kept as integers (i.e., without
decimals)?}
\item{...}{Other arguments to pass to \code{\link[insight:format_value]{insight::format_value()}} such as \code{digits}, etc.}
}
\description{
Transform a standardized vector into character, e.g., \code{c("-1 SD", "Mean", "+1 SD")}.
}
\examples{
format_standardize(c(-1, 0, 1))
format_standardize(c(-1, 0, 1, 2), reference = rnorm(1000))
format_standardize(c(-1, 0, 1, 2), reference = rnorm(1000), robust = TRUE)
format_standardize(standardize(mtcars$wt), digits = 1)
format_standardize(standardize(mtcars$wt, robust = TRUE), digits = 1)
}
|