EdwinTh / padr

Padding of missing records in time series
https://edwinth.github.io/padr/
Other
132 stars 12 forks source link

Strange error when there are NAs in the date column #42

Closed danielsjf closed 7 years ago

danielsjf commented 7 years ago

I'm using the pad function, but it throws a strange error when there are missing values in the NA column.

(reprex compatible)

library(tidyverse)
library(padr)
tibble(date = c(ISOdate(2016,1,1,0:15),NA,ISOdate(2016,1,1,17:23)), type = 'test', value = runif(24)) %>% 
  pad()

Error:

Error in if (total_invalid == nrow(x)) { : 
  missing value where TRUE/FALSE needed
In addition: Warning message:
In if (unique(nchar(x_char)) == 10) { :
  the condition has length > 1 and only the first element will be used
EdwinTh commented 7 years ago

This is already fixed in #34 and #35