EdwinTh/padr

Strange error when there are NAs in the date column

danielsjf opened this issue · 1 comments

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

This is already fixed in #34 and #35