x <- ip_address(c("192.168.0.1", "2001:db8::8a2e:370:7334", NA))
ip_to_integer(x)
integer_to_ip(ip_to_integer(x))
# with IPv4 only, we can use numeric data type
as.numeric(ip_to_integer(ip_address("192.168.0.1")))
integer_to_ip(3232235521)
Run the code above in your browser using DataLab