You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[character(1)] Check for names. See checkNamed for possible values. Default is “any” which performs no check at all. Note that you can use checkSubset to check for a specific set of names.
So am I supposed to use checkSubset() inside checkCharacter()? How?
Thank you for your time taken!
The text was updated successfully, but these errors were encountered:
You seem to misunderstand what the manual says: the possible values for the names argument of checkCharacter are listed in ?checkNamed (see the type argument). So you can have sthing like:
checkCharacter(c(a = "A", b = "B"), names = "unique") # this passes
#checkCharacter(c(a = "A", b = "B"), names = "unnamed") # this fails
If you want to check for a specific set of names, you have to use checkSubset:
x <- c(a = "A", b = "B")
assert(
checkCharacter(x),
checkSubset(names(x), choices = base::letters),
combine = "and"
)
Hey,
first off, thanks for the great package!
In
checkCharacter()
, argnames =
you write:checkSubset()
insidecheckCharacter()
? How?Thank you for your time taken!
The text was updated successfully, but these errors were encountered: