R/predict.OKrig.R

predict.OKrig <- function (object, x = NULL,...)  # ... for consistency with generic
{
  if (is.null(x)) { ## call 'predict(fitobject)'
    x <- object$x
  } else if ( is.vector(x) ) {
    x <- t(x) ## row vector in matrix class
  } else if ( ! is.matrix(x) ) { ## 2D object of the wrong class
    x <- t(t(x))
  }
  if (nrow(x)==1) { ## single point
    temp <- Cpredict(x, object)
  } else {
    temp <- apply(x, 1, function(v) {Cpredict(v, object)})
  }
  return(c(temp))
}

Try the blackbox package in your browser

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

blackbox documentation built on May 29, 2024, 1:15 a.m.