graph_data_rspde: Data extraction from metric graphs for 'rSPDE' models

graph_data_rspdeR Documentation

Data extraction from metric graphs for 'rSPDE' models

Description

Extracts data from metric graphs to be used by 'INLA' and 'inlabru'.

Usage

graph_data_rspde(
  graph_rspde,
  name = "field",
  repl = NULL,
  group = NULL,
  group_col = NULL,
  only_pred = FALSE,
  loc = NULL,
  loc_name = NULL,
  tibble = FALSE,
  drop_na = FALSE,
  drop_all_na = TRUE
)

Arguments

graph_rspde

An inla_metric_graph_spde object built with the rspde.metric_graph() function.

name

A character string with the base name of the effect.

repl

Which replicates? If there is no replicates, one can set repl to NULL. If one wants all replicates, then one sets to repl to .all.

group

Which groups? If there is no groups, one can set group to NULL. If one wants all groups, then one sets to group to .all.

group_col

Which "column" of the data contains the group variable?

only_pred

Should only return the data.frame to the prediction data?

loc

Locations. If not given, they will be chosen as the available locations on the metric graph internal dataset.

loc_name

Character with the name of the location variable to be used in 'inlabru' prediction.

tibble

Should the data be returned as a tidyr::tibble?

drop_na

Should the rows with at least one NA for one of the columns be removed? DEFAULT is FALSE. This option is turned to FALSE if only_pred is TRUE.

drop_all_na

Should the rows with all variables being NA be removed? DEFAULT is TRUE. This option is turned to FALSE if only_pred is TRUE.

Value

An 'INLA' and 'inlabru' friendly list with the data.


rSPDE documentation built on Nov. 6, 2023, 1:06 a.m.