Skip to content

Commit

Permalink
Add missing dates check, formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
QSparks committed Nov 7, 2024
1 parent c28faec commit fa08c1a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
3 changes: 3 additions & 0 deletions R/GenericVariable_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ check.generic.argument.validity <- function(
if (missing(data) || is.null(data)) {
stop(paste(name, "argument is missing."))
}
if (missing(dates)) {
stop("Argument 'dates' is missing.")
}
if (length(data) == 0 || length(dates) == 0) {
stop(paste(name, "and dates must not be empty vectors."))
}
Expand Down
15 changes: 8 additions & 7 deletions R/climdexGenericScalar.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,14 @@ climdexGenericScalar.raw <- function(
namasks <- generate_namasks(filled.list, date.factors, max.missing.days)

return(new("climdexGenericScalar",
data = filled.list[["data"]],
dates = date.series,
date.factors = date.factors,
jdays = jdays,
namasks = namasks,
northern.hemisphere = northern.hemisphere,
max.missing.days = max.missing.days))
data = filled.list[["data"]],
dates = date.series,
date.factors = date.factors,
jdays = jdays,
namasks = namasks,
northern.hemisphere = northern.hemisphere,
max.missing.days = max.missing.days
))
}

#' @title climdexGenericScalar.csv
Expand Down

0 comments on commit fa08c1a

Please sign in to comment.