Skip to content

Commit

Permalink
Add method to coerse SimInf_events to a data.frame
Browse files Browse the repository at this point in the history
  • Loading branch information
stewid committed Feb 5, 2020
1 parent 68a2499 commit ba95edd
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
@@ -1,5 +1,6 @@
# Generated by roxygen2: do not edit by hand

S3method(as.data.frame,SimInf_events)
export("gdata<-")
export("punchcard<-")
export("select_matrix<-")
Expand Down
10 changes: 10 additions & 0 deletions R/SimInf_events.R
Expand Up @@ -369,6 +369,16 @@ setAs(from = "SimInf_events",
}
)

##' Coerce to data frame
##'
##' @method as.data.frame SimInf_events
##'
##' @inheritParams base::as.data.frame
##' @export
as.data.frame.SimInf_events <- function(x, ...) {
as(x, "data.frame")
}

##' Plot scheduled events
##'
##' @param x the time points of the events.
Expand Down
16 changes: 16 additions & 0 deletions man/as.data.frame.SimInf_events.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ba95edd

Please sign in to comment.