| checkNamed {checkmate} | R Documentation |
Check if an argument is named
checkNamed(x, type = "named") assertNamed(x, type = "named", .var.name) testNamed(x, type = "named")
x |
[ANY] |
.var.name |
[character(1)] |
type |
[character(1)] |
Depending on the function prefix:
If the check is successful, all functions return TRUE.
If the check is not successful, assertNamed throws an error message,
testNamed returns FALSE and checkNamed returns
a string with the error message.
x = 1:3 testNamed(x, "unnamed") names(x) = letters[1:3] testNamed(x, "unique")