diff --git a/NAMESPACE b/NAMESPACE index 6de7014..ed39bf6 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,5 +1,6 @@ # Generated by roxygen2: do not edit by hand +S3method(plot,edObject) S3method(print,edObject) export(buildEDModel) export(detectEvents) diff --git a/R/detectEvents.R b/R/detectEvents.R index af55e4a..ea67327 100644 --- a/R/detectEvents.R +++ b/R/detectEvents.R @@ -141,6 +141,10 @@ detectEvents <- function(x, return(edModel) } +model_name <- function(x, ...){ + sub("forecast_", "", class(x)[1]) +} + #' Print an Event Detection Object #' #' Prints the last classification results for an event detection object. @@ -155,10 +159,10 @@ print.edObject <- function(x, ...){ nModels <- length(x$modelList) if(nModels > 1){ writeLines(paste0("Event Detection Object with ", nModels, " " - , class(x$modelList[[1]])[1], " submodels")) + , model_name(x$modelList[[1]]), " submodels")) }else if(nModels == 1){ writeLines(paste0("Event Detection Object with 1 " - , class(x$modelList[[1]])[1], " submodel")) + , model_name(x$modelList[[1]]), " submodel")) }else{ writeLines("Event Detection Object with no fitted models") } diff --git a/man/plot.edObject.Rd b/man/plot.edObject.Rd index da8a66a..ddd6f53 100644 --- a/man/plot.edObject.Rd +++ b/man/plot.edObject.Rd @@ -8,5 +8,5 @@ varsToPlot = names(edObject$classification)) } \description{ -export +Plot an Event Detection Object }