Skip to content

Commit 6831b8f

Browse files
Merge pull request #47 from francoscarafia/master
Vectorizing ic_datetime warning message
2 parents d06f8fe + 12c47e5 commit 6831b8f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

R/ic_date.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
ic_datetime <- function(x) {
1111

1212
# TODO (LH): regex check x timestamp
13-
if(!is.na(x) & !x == "NA" & !grepl("^\\d{8}T\\d{6}Z?$", x)) {
13+
if(any(!is.na(x) & !(x == "NA") & !grepl("^\\d{8}T\\d{6}Z?$", x))) {
1414
# stop("time should be in this format: 20180809T160000Z")
1515
warning("Non-standard time string: should be in this format: 20180809T160000Z")
1616
x = ""

0 commit comments

Comments
 (0)