% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/extrafunctions.R
\name{mesh_helper}
\alias{mesh_helper}
\title{Generates the required mesh data from fmesher for SPDE approximations}
\usage{
mesh_helper(locs, pred_locs = NULL, max_edge, cutoff, offset, ...)
}
\arguments{
\item{locs}{A nx2 data frame of observation locations}

\item{pred_locs}{An optional data frame of prediction locations.}

\item{max_edge}{The largest allowed triangle edge length. One or two values.}

\item{cutoff}{The minimum allowed distance between points. Point at most as far apart as this are replaced by a single vertex prior to the mesh refinement step.}

\item{offset}{The automatic extension distance. One or two values, for an inner and an optional outer extension. If negative, interpreted as a factor relative to the approximate data diameter}

\item{...}{Other arguments passed to `fm_mesh_2d`}
}
\value{
A list with A, C, and G sparse matrices to be passed to `Model$new()`
}
\description{
For SPDE Gaussian Process approximations we require a mesh passed to a Model object. This function
takes the locations and arguments passed to `fm_mesh_2d` and returns the required data, including basis
matrices.
}
\examples{
df <- data.frame(
x = runif(100, -1, 1),
y = runif(100, -1, 1))
mesh <- mesh_helper(df, max_edge = c(0.15, 0.75), cutoff = 0.075, offset = c(0.1,0.3))
}
