Nothing
#' Validate inputs for GWRF fitting
#'
#' @param formula A model formula.
#' @param data A data frame.
#' @param coords Numeric matrix or data frame with 2 columns.
#'
#' @return Invisibly TRUE if checks pass.
#' @keywords internal
check_gwrf_inputs <- function(formula, data, coords) {
if (!inherits(formula, "formula")) {
stop("formula must be a valid model formula.")
}
if (!is.data.frame(data)) {
stop("data must be a data frame.")
}
coords <- as.matrix(coords)
if (!is.numeric(coords) || ncol(coords) != 2) {
stop("coords must be numeric with exactly 2 columns.")
}
if (nrow(coords) != nrow(data)) {
stop("coords and data must have the same number of rows.")
}
mf <- model.frame(formula, data = data, na.action = stats::na.pass)
if (nrow(mf) != nrow(data)) {
stop("model.frame row count does not match data.")
}
response <- model.response(mf)
if (!is.numeric(response)) {
stop("Version 1 supports numeric regression responses only.")
}
invisible(TRUE)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.