| cov_grid_2d | R Documentation |
The two-dimensional counterpart of cov_grid, used by
HMM$plot_2d(). Both var and var2 are varied over a
regular n_grid by n_grid lattice spanning their ranges in the
data, and every other covariate is held at one value, as in
cov_grid: the one given in covs, otherwise the mean of
a numeric covariate or the first level of a factor.
cov_grid_2d(
var,
var2,
data = NULL,
obj = NULL,
covs = NULL,
formulas,
n_grid = 40,
padding = 0
)
var |
Name of the first covariate, on the x axis |
var2 |
Name of the second covariate, on the y axis |
data |
Data frame of covariate values |
obj |
HMM model object, used to find the covariates if |
covs |
Optional named list of values for the other covariates |
formulas |
List of model formulas |
n_grid |
Number of points along each axis, so the grid has
|
padding |
Numeric vector of length 1 or 2 giving the amount to pad the 'var' and 'var2' ranges beyond the data. A single value is recycled to both axes, and a length-2 vector is interpreted as (padding in var, padding in var2). Defaults to 0. |
The lattice is regular because that is what ggplot2::geom_raster()
needs, and var varies fastest, so that the result can be reshaped
into a matrix column by column.
Data frame with n_grid^2 rows and one column for each
covariate
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.