R/predictEmail.R

Defines functions predictEmail

Documented in predictEmail

#' predictEmail
#'
#' Predict whether an email is spam or not
#' @param email The email to be checked
#' @return Character "spam" if it is suspected to be spam, otherwise "ham"
#' @examples
#' predictEmail("This is my email")
#' @export
#'
predictEmail <- function(email) {
  attr <- textToAttribute(email)

  pred <- predict(svmModel,attr[,1:57])
  return(levels(pred)[pred])
}
megahf/spamfilter documentation built on May 29, 2019, 4:42 a.m.