R/predict.R

#' A pred Function
#'
#' This function allows you to....
#' @param url the previous URL
#' @keywords pred
#' @export
#' @examples
#' pred()
pred <- function(url) {
  #print (url)
  out <- tryCatch(
    {
      #markovchain::predict(model$estimate, newdata = url)
      mcu[mcu$Row.Labels == url,]$pred[1]
      #class(model$estimate)[1]
    },
    error=function(cond) {
      NA
    })
  if (identical(out, character(0))){
    out <- NA
  }
  return (out)
}
asstergi/R-stuff documentation built on May 19, 2019, 4:05 p.m.