Permalink
Browse files

[Fix #270] Add check for empty unit names in `standardise_lt_names`

  • Loading branch information...
vspinu committed Dec 13, 2014
1 parent c9d832b commit c11cbfee3592251477284b4c576d31bac4f22cb6
Showing with 2 additions and 0 deletions.
  1. +2 −0 R/util.r
View
@@ -60,6 +60,8 @@ standardise_period_names <- function(x) {
}
standardise_lt_names <- function(x) {
if(length(x) == 0L)
stop("No unit names supplied.")
dates <- c("sec", "min", "hour", "day", "mday", "wday", "yday", "mon", "year", "tz")
y <- gsub("(.)s$", "\\1", x)
y <- substr(y, 1, 3)

0 comments on commit c11cbfe

Please sign in to comment.