View source: R/visualisation_matrix.R
visualisation_matrix | R Documentation |
This function is an alias (another name) for the insight::get_datagrid()
function. Same arguments apply.
visualisation_matrix(x, ...)
## S3 method for class 'data.frame'
visualisation_matrix(
x,
by = "all",
factors = "reference",
numerics = "mean",
preserve_range = FALSE,
reference = x,
...
)
## S3 method for class 'numeric'
visualisation_matrix(x, ...)
## S3 method for class 'factor'
visualisation_matrix(x, ...)
x |
An object from which to construct the reference grid. |
... |
Arguments passed to or from other methods (for instance, |
by |
Indicates the focal predictors (variables) for the reference grid
and at which values focal predictors should be represented. If not specified
otherwise, representative values for numeric variables or predictors are
evenly distributed from the minimum to the maximum, with a total number of
There is a special handling of assignments with brackets, i.e. values
defined inside
For factor variables, the value(s) inside the brackets should indicate
one or more factor levels, like The remaining variables not specified in |
factors |
Type of summary for factors. Can be |
numerics |
Type of summary for numeric values. Can be |
preserve_range |
In the case of combinations between numeric variables
and factors, setting |
reference |
The reference vector from which to compute the mean and SD.
Used when standardizing or unstandardizing the grid using |
Reference grid data frame.
library(modelbased)
# Add one row to change the "mode" of Species
data <- rbind(iris, iris[149, ], make.row.names = FALSE)
# Single variable is of interest; all others are "fixed"
visualisation_matrix(data, by = "Sepal.Length")
visualisation_matrix(data, by = "Sepal.Length", length = 3)
visualisation_matrix(data, by = "Sepal.Length", range = "ci", ci = 0.90)
visualisation_matrix(data, by = "Sepal.Length", factors = "mode")
# Multiple variables are of interest, creating a combination
visualisation_matrix(data, by = c("Sepal.Length", "Species"), length = 3)
visualisation_matrix(data, by = c(1, 3), length = 3)
visualisation_matrix(data, by = c("Sepal.Length", "Species"), preserve_range = TRUE)
visualisation_matrix(data, by = c("Sepal.Length", "Species"), numerics = 0)
visualisation_matrix(data, by = c("Sepal.Length = 3", "Species"))
visualisation_matrix(data, by = c("Sepal.Length = c(3, 1)", "Species = 'setosa'"))
# with list-style at-argument
visualisation_matrix(data, by = list(Sepal.Length = c(1, 3), Species = "setosa"))
# Standardize
vizdata <- visualisation_matrix(data, by = "Sepal.Length")
standardize(vizdata)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.