Skip to content

Commit

Permalink
Make as_forecast() a generic
Browse files Browse the repository at this point in the history
  • Loading branch information
nikosbosse committed Dec 16, 2023
1 parent dd1a662 commit 0b6958e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by roxygen2: do not edit by hand

S3method(as_forecast,default)
S3method(print,scoringutils_check)
S3method(quantile_to_interval,data.frame)
S3method(quantile_to_interval,numeric)
Expand Down
8 changes: 7 additions & 1 deletion R/validate.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@
#' @examples
#' as_forecast(example_binary)
#' as_forecast(example_quantile)
as_forecast <- function(data) {
as_forecast <- function(data, ...) {
UseMethod("as_forecast")
}

#' @rdname as_forecast
#' @export
as_forecast.default <- function(data, ...) {
assert(check_data_columns(data))

# find forecast type
Expand Down
7 changes: 6 additions & 1 deletion man/as_forecast.Rd

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

0 comments on commit 0b6958e

Please sign in to comment.