| assert_all_are_ip_addresses {assertive.data} | R Documentation |
Checks that the input contains IP addresses. (It does not check that the address exists, merely that the string is in a suitable format.)
assert_all_are_ip_addresses(x, na_ignore = FALSE,
severity = getOption("assertive.severity", "stop"))
assert_any_are_ip_addresses(x, na_ignore = FALSE,
severity = getOption("assertive.severity", "stop"))
is_ip_address(x)
x |
Input to check. |
na_ignore |
A logical value. If |
severity |
How severe should the consequences of the assertion be?
Either |
A logical vector that is TRUE when the input contains valid IP
addresses.
Valid IP addresses are considered to be four integers in the range 0 to 255, separated by dots, or the string "localhost".
x <- c( localhost = "localhost", valid_address = "255.0.255.0", out_of_range = "1.2.3.256", five_blocks = "1.2.3.4.5", non_numeric = "1.2.3.Z", missing_block = "1.2.3.NA", missing = NA ) is_ip_address(x) assert_any_are_ip_addresses(x) #These examples should fail. assertive.base::dont_stop(assert_all_are_ip_addresses(x))