multivariate_grid: Multivariate Grid
Description
This function creates a multivariate grid. Each column of the input x is turned
(independently) into a vector of grid values via univariate_grid().
Combinations are then formed by calling expand.grid().
Usage
multivariate_grid(
x,
grid_size = 49L,
trim = c(0.01, 0.99),
strategy = c("uniform", "quantile"),
na.rm = TRUE
)Value
A vector, matrix, or data.frame with evaluation points.
Arguments
- x
A vector, matrix, or data.frame to turn into a grid of values.
- grid_size
Controls the approximate grid size. If x has p columns, then each
(non-discrete) column will be reduced to about the p-th root of grid_size values.
- trim
The default c(0.01, 0.99) means that values outside the
1% and 99% quantiles of non-discrete numeric columns are removed before calculation
of grid values. Set to 0:1 for no trimming.
- strategy
How to find grid values of non-discrete numeric columns?
Either "uniform" or "quantile", see description of univariate_grid().
- na.rm
Should missing values be dropped from the grid? Default is TRUE.
Examples
Run this codemultivariate_grid(iris[1:2], grid_size = 4)
multivariate_grid(iris$Species) # Works also in the univariate case
Run the code above in your browser using DataLab