View source: R/describe_distribution.R
describe_distribution | R Documentation |
This function describes a distribution by a set of indices (e.g., measures of centrality, dispersion, range, skewness, kurtosis).
describe_distribution(x, ...) ## S3 method for class 'numeric' describe_distribution( x, centrality = "mean", dispersion = TRUE, iqr = TRUE, range = TRUE, quartiles = FALSE, ci = NULL, iterations = 100, threshold = 0.1, verbose = TRUE, ... ) ## S3 method for class 'factor' describe_distribution(x, dispersion = TRUE, range = TRUE, verbose = TRUE, ...) ## S3 method for class 'data.frame' describe_distribution( x, select = NULL, exclude = NULL, centrality = "mean", dispersion = TRUE, iqr = TRUE, range = TRUE, quartiles = FALSE, include_factors = FALSE, ci = NULL, iterations = 100, threshold = 0.1, ignore_case = FALSE, regex = FALSE, verbose = TRUE, ... )
x |
A numeric vector, a character vector, a data frame, or a list. See
|
... |
Additional arguments to be passed to or from methods. |
centrality |
The point-estimates (centrality indices) to compute. Character (vector) or list with one or more of these options: |
dispersion |
Logical, if |
iqr |
Logical, if |
range |
Return the range (min and max). |
quartiles |
Return the first and third quartiles (25th and 75pth percentiles). |
ci |
Confidence Interval (CI) level. Default is |
iterations |
The number of bootstrap replicates for computing confidence
intervals. Only applies when |
threshold |
For |
verbose |
Toggle warnings and messages. |
select |
Variables that will be included when performing the required tasks. Can be either
If |
exclude |
See |
include_factors |
Logical, if |
ignore_case |
Logical, if |
regex |
Logical, if |
If x
is a data frame, only numeric variables are kept and will be
displayed in the summary.
If x
is a list, the behavior is different whether x
is a stored list. If
x
is stored (for example, describe_distribution(mylist)
where mylist
was created before), artificial variable names are used in the summary
(Var_1
, Var_2
, etc.). If x
is an unstored list (for example,
describe_distribution(list(mtcars$mpg))
), then "mtcars$mpg"
is used as
variable name.
A data frame with columns that describe the properties of the variables.
select
argumentFor most functions that have a select
argument (including this function),
the complete input data frame is returned, even when select
only selects
a range of variables. That is, the function is only applied to those variables
that have a match in select
, while all other variables remain unchanged.
In other words: for this function, select
will not omit any non-included
variables, so that the returned data frame will include all variables
from the input data frame.
There is also a
plot()
-method
implemented in the
see-package.
describe_distribution(rnorm(100)) data(iris) describe_distribution(iris) describe_distribution(iris, include_factors = TRUE, quartiles = TRUE) describe_distribution(list(mtcars$mpg, mtcars$cyl))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.