Skip to content

Commit

Permalink
better error messages when time col contains NA fix #184
Browse files Browse the repository at this point in the history
  • Loading branch information
christophsax committed Jul 25, 2021
1 parent 2edb099 commit 6586a45
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
12 changes: 7 additions & 5 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
# tsbox 0.2.1.9000 (2021-??-??)


## Features

- export ts_first_of_period #178
- regular zoo and xts can be processed #175, #189
- ts_na_interpolation() exported and added to examples in ?ts_examples #127
- point to tempdisagg::td() for low to high frequency conversion #142
- better error messages if series contain duplicates #181
- better error messages when converting one row data frames #179


## Bug fixes

Expand All @@ -18,6 +13,13 @@
- tslist: Use ids to name single elements if possible #194
- ts_bind works with short series and scalars #197

## Documentation

- point to tempdisagg::td() for low to high frequency conversion #142
- better error messages if series contain duplicates #181
- better error messages when converting one row data frames #179
- better error messages when time col contains NA #184


# tsbox 0.2.1 (2020-04-29)

Expand Down
2 changes: 1 addition & 1 deletion R/dts_helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dts_init <- function(x){
)
} else {
stop(
"Series contains duplicated timestamps: ",
"Series contains duplicated values in time column: ",
unique(x[[cname$time]][duplicated(x[[cname$time]])]),
call. = FALSE
)
Expand Down
4 changes: 4 additions & 0 deletions R/ts_regular.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ regular_core <- function(x) {
setnames(x, ctime, "time")

regular_core_one <- function(x) {
if (any(is.na(x$time))) {
stop("Time column contains missing values.", call. = FALSE)
}

if (is_regular_one_basic(x$time)) return(x)
reg.time <- regularize_date(x$time)
if (is.null(reg.time)) {
Expand Down

0 comments on commit 6586a45

Please sign in to comment.