Learn R Programming

IP (version 0.1)

Comparison: Methods for IP Comparison

Description

Methods for IP binary comparison

Arguments

e1, e2

objects of either class 'IPv4', 'IPv6'or 'IP'

Value

a logical vector

Methods

x == y

x != y

x > y

x < y

x >= y

x <= y

Details

Only the == operator is supported for ranges

Examples

Run this code
# NOT RUN {
  ##
  ip1 <- ip(c("192.0.0.1", "fd00::1")) + rep(c(0:2),each=2)
  ##
  ip2 <- ip1 + rep(c(1,-1,0), each=2)
  ##
  data.frame(
    ip1, ip2
    , lt = ip1<ip2
    , le = ip1<=ip2
    , eq = ip1==ip2
    , ge = ip1>=ip2
    , gt = ip1>ip2
  )
# }

Run the code above in your browser using DataLab