iptools 0.4.0 released into the wild (i.e. is hitting the CRAN mirrors today)

April 4, 2016

(This article was first published on R – rud.is, and kindly contributed to R-bloggers)

The iptools package—a toolkit for manipulating, validating and testing IP addresses and ranges, along with datasets relating to IP addresses—is flying through the internets and hitting a CRAN mirror near you, soon.

What’s fixed?

Tim Smith fixed a bug in ip_in_range() that occurred when the netmask was /32 (thanks, Tim!).

What’s new?

The range_boundaries() function now returns the three new fields that are pretty obvious once you see it in action:

##   minimum_ip  maximum_ip min_numeric max_numeric         range
## 1  2886860800  2886860815

They are tacked on the end, so if you were using positional or named columns previously, you’re still good to go.

We’ve added a new country_ranges() function to return all “assigned” CIDR blocks in a country. You just give it character vector of one or more ISO 3166-1 alpha-2 codes and you get back the CIDRs:

## $TO
## [1] ""  "" "" "" "" ""   
## [7] ""

This data is updated daily and there’s some session caching built-into the function to speed up subsequent calls if you forgot to save the output. You can flush the session cache with flush_country_cidrs() and query it with cached_country_cidrs().

What’s next?

We’re waiting until the R 3.3.0 Windows toolchain is stable to add in MaxMind ASN lookups. If there are any IP-related functions you need added, drop us an issue. We’re at nearly 1,700 downloads from the RStudio mirror, which (IMO) is kinda cool for such a niche package. Many thanks to all our users and one more thank you to Dirk for the AsioHeaders package.


If you want some “bad” IP addresses to play around with in iptools, check out the blocklist package, which provides an interface to a subset of the blocklist.de API.

To leave a comment for the author, please follow the link and comment on their blog: R – rud.is.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)