Closed franknarf1 closed 6 years ago
A possible solution (and unfortunately of the manual and not magic variety):
DATE8.SUB <- vet_token(
!anyNA(date8_toIDate(.)),
"date8_toIdate(%s) should not contain NAs, but does"
)
vet(DATE8.SUB && INT, y)
## [1] "date8_toIdate(`y` ) should not contain NAs, but does"
There is a string formatting issue with an extra space getting injected that I'll have to fix.
Note that you only need to use vet_token
if you want to supply a custom message was we do here. In normal use where vet
writes its own messages you can just use quote
.
Works for me; thanks. I hadn’t really understood that that’s what that arg is for.
From my recent issue (#85): I'm testing if a numeric input can be interpreted as an 8-digit date:
It would be nice if the token was somehow magically parsed so that the message was instead...
Alternately, maybe there could be syntax so I can write my token as..
with the messaging behavior mentioned above.