powered by
These functions yield equivalent representations of the network mask.
prefix_length(x)netmask(...)hostmask(...)# S3 method for ip_network netmask(x, ...)# S3 method for ip_network hostmask(x, ...)# S3 method for ip_interface netmask(x, ...)# S3 method for ip_interface hostmask(x, ...)# S3 method for default netmask(prefix_length = integer(), is_ipv6 = logical(), ...)# S3 method for default hostmask(prefix_length = integer(), is_ipv6 = logical(), ...)
netmask(...)
hostmask(...)
# S3 method for ip_network netmask(x, ...)
# S3 method for ip_network hostmask(x, ...)
# S3 method for ip_interface netmask(x, ...)
# S3 method for ip_interface hostmask(x, ...)
# S3 method for default netmask(prefix_length = integer(), is_ipv6 = logical(), ...)
# S3 method for default hostmask(prefix_length = integer(), is_ipv6 = logical(), ...)
An ip_network or ip_interface vector
ip_network
ip_interface
Arguments to be passed to other methods
An integer vector
A logical vector
prefix_length() returns an integer vector
prefix_length()
netmask() and hostmask() return an ip_address vector
netmask()
hostmask()
ip_address
max_prefix_length()
# NOT RUN { x <- ip_network(c("192.168.0.0/22", "2001:db00::0/26")) prefix_length(x) netmask(x) hostmask(x) netmask(c(22L, 26L), c(FALSE, TRUE)) hostmask(c(22L, 26L), c(FALSE, TRUE)) # }
Run the code above in your browser using DataLab