R/predict_gwrf_fit.R

Defines functions predict.gwrf_fit

Documented in predict.gwrf_fit

#' Return fitted local predictions
#'
#' @param object A gwrf_fit object.
#' @param ... Unused.
#'
#' @return A numeric vector containing the fitted local prediction for each
#' focal observation represented in `object$local_results`, in the same order
#' as the rows of that table.
#'
#' @examples
#' example_fit <- structure(
#'   list(
#'     local_results = data.frame(
#'       prediction = c(1.2, 2.1, 2.8)
#'     )
#'   ),
#'   class = "gwrf_fit"
#' )
#'
#' predict(example_fit)
#' @export
predict.gwrf_fit <- function(object, ...) {
  object$local_results$prediction
}

Try the gwrf package in your browser

Any scripts or data that you put into this service are public.

gwrf documentation built on Aug. 24, 2026, 5:15 p.m.