Code Monkey home page Code Monkey logo

ipaddress's Introduction

ipaddress

CRAN status R build status Coverage status

ipaddress provides data classes and functions for working with IP addresses and networks. Its interface is inspired by the Python ipaddress module.

Here are some key features:

  • Functions to generate and analyze IP data
  • Full support for both IPv4 and IPv6 address spaces
  • Data stored in native bit format for reduced memory footprint
  • Calculations written in C++ for fast performance
  • Compatible with the tidyverse

For data visualization of IP addresses and networks, check out the ggip package.

Installation

Install the released version from CRAN with:

install.packages("ipaddress")

Install the development version from GitHub with:

# install.packages("remotes")
remotes::install_github("davidchall/ipaddress")

Usage

Use ip_address() and ip_network() to create standalone vectors or data frame columns.

library(tibble)
library(ipaddress)

address <- ip_address(c("192.168.0.1", "2001:db8::8a2e:370:7334"))
network <- ip_network(c("192.168.100.0/22", "2001:db8::/80"))

tibble(address, network)
#> # A tibble: 2 × 2
#>                   address          network
#>                 <ip_addr>       <ip_netwk>
#> 1             192.168.0.1 192.168.100.0/22
#> 2 2001:db8::8a2e:370:7334    2001:db8::/80

It looks like we’ve simply stored the character vector, but we’ve actually validated each input and stored its native bit representation. When the vector is displayed, the print() method formats each value back to the human-readable character representation. There are two main advantages to storing IP data in their native bit representation:

  • The data occupy less space in memory (up to 80% reduction),
  • Subsequent use is much faster, since we don’t repeatedly parse the character vector.

Read vignette("ip-data") to learn more about these vector classes. For a demonstration of common recipes using ipaddress vectors and functions, see vignette("recipes").

Related work

  • iptools – A well established R package for working with IP addresses and networks. Unfortunately IPv6 support is severely limited. Also, addresses and networks are stored as character vectors, so they must be parsed to their native bit representation for every operation. It served as an excellent guide and motivation for ipaddress.
  • cyberpandas – A Python package for using IP addresses in a pandas DataFrame. This offers full support for IPv6 and stores addresses in the native bit representation. However, most “interesting” operations must deserialize each address to a Python ipaddress object, which is slow. It also doesn’t support IP networks.

Please note that the ipaddress project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

ipaddress's People

Contributors

davidchall avatar davisvaughan avatar eddelbuettel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ipaddress's Issues

Suggested package 'bignum' used unconditionally

Bug description

When testing reverse dependencies, I noticed that package ipaddress failed its tests ... simply because the suggested package bignum was not installed.

The Writing R Extensions manual has refined its wording on this over the years and implies, to the reading of many of us, that 'suggested' packages should be used only conditionally.

Hence, I would be happy to send you a quick PR if you agree---there are other schools of thought that claim that tests should always ensure all suggested packages are present (interpreting it as, if you will, 'test-Depends' -- which I think is wrong: on the marging we might run two tests once narrow with only hard dependencies and once wide with all). Of course, there may be other packages in your Suggests that may benefit from similar treatment, the machine where I test has by now a fairly extended set of packages installed. And the issue won't arise next time as I now did the manual step. So by all means feel free to close this---though I remain of the view that a simple test wrapping the use of the suggested package is a cleaner approach in line with the recommentations from WRE.

To Reproduce

Run R CMD check ipaddres_*tar.gz on a system (or in a container) without bignum installed.

Additional context

N/A

Release ipaddress 0.5.2

Prepare for release:

  • Check current CRAN check results
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • rhub::check(platform = 'solaris-x86-patched')
  • rhub::check(platform = 'ubuntu-rchk')
  • rhub::check_with_sanitizers()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version()

Release ipaddress 0.3.0

Prepare for release:

  • devtools::build_readme()
  • Check current CRAN check results
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • rhub::check(platform = 'solaris-x86-patched')
  • rhub::check(platform = 'ubuntu-rchk')
  • rhub::check_with_sanitizers()
  • Update cran-comments.md
  • Polish NEWS

Submit to CRAN:

  • usethis::use_version('minor')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version()

Feature parity with Python's ipaddress module

Some day we'll hopefully have feature parity with the Python module. This list can help keep track.

Note that the R package might not use exactly the same interface. If a feature of the Python package is achievable in the R package, it will be considered "done".

ip_address class

  • construct from string (IPv4: dot-decimal, IPv6: hexadecimal)
  • construct from integer
  • construct from bytes
  • comparison operators
  • addition/subtraction operators
  • packed
  • reverse_pointer
  • ipv4_mapped
  • sixtofour
  • teredo

ip_network class

  • construct from string (CIDR)
  • construct from string (address + prefix length)
  • construct from string (address + netmask)
  • construct from string (address + hostmask)
  • construct from integer
  • construct from bytes
  • network_address
  • broadcast_address
  • hostmask
  • netmask
  • prefixlen
  • num_addresses
  • hosts()
  • overlaps()
  • address_exclude()
  • subnets()
  • supernet()
  • subnet_of()
  • supernet_of()
  • comparison operators
  • iteration
  • is address in network

ip_interface class

  • ip
  • network
  • hostmask
  • netmask
  • prefixlen
  • comparison operators

all classes

  • string representation
  • integer representation
  • exploded (IPv6)
  • version
  • max_prefixlen
  • is_multicast
  • is_private
  • is_global
  • is_unspecified
  • is_reserved
  • is_loopback
  • is_link_local
  • is_site_local

Other

  • v4_int_to_packed()
  • v6_int_to_packed()
  • summarize_address_range()
  • collapse_addresses()
    get_mixed_key_type()

macOS cannot build from source

macOS builds (latest and devel R) have consistently been failing with the following error:

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/gethostuuid.h:39:17: error: C++ requires a type specifier for all declarations
int gethostuuid(uuid_t, const struct timespec *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA);
                ^

I tried reverting the commit, but the builds still fail. So it's not related to my code.

It builds fine on my local machine. Did a bit of investigating and found that this data type is defined in /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_uuid_t.h. It seems that the GitHub Actions image can no longer find this file. However, their images haven't changed recently.

After a bit more inspection, I realized that the Rcpp version had been upgraded when these builds started failing. Then I found this issue: RcppCore/Rcpp#1046

Looks like this will be fixed in the next release of Rcpp (v1.0.5).

Release ipaddress 0.5.4

Prepare for release:

  • Check current CRAN check results
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • rhub::check(platform = 'ubuntu-rchk')
  • rhub::check_with_sanitizers()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version()

Release ipaddress 0.5.1

Prepare for release:

  • devtools::build_readme()
  • Check current CRAN check results
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • rhub::check(platform = 'solaris-x86-patched')
  • rhub::check(platform = 'ubuntu-rchk')
  • rhub::check_with_sanitizers()
  • Update cran-comments.md
  • Polish NEWS

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version()

Release ipaddress 0.1.0

Prepare for release:

  • Check that description is informative
  • Check licensing of included files
  • usethis::use_cran_comments()
  • devtools::check()
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • rhub::check(platform = 'ubuntu-rchk')
  • rhub::check_with_sanitizers()
  • Polish pkgdown reference index

Submit to CRAN:

  • Update cran-comments.md
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version()

Release ipaddress 1.0.2

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Polish NEWS
  • urlchecker::url_check()
  • devtools::build_readme()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • git push

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version(push = TRUE)

Create prefix length from netmask/hostmask

We can create netmask/hostmask from prefix length, but we still need the ability to do the reverse. Do this by making prefix_length() an S3 method.

Need to decide how to handle ambiguous cases (all zeros, all ones). Follow convention set by Python ipaddress module here.

Reconsider signature of one-to-many functions

There are now several one-to-many functions, but some return a vector while others return a list of vectors.

Function Input type Output type
ip_to_hostname() Vector Vector (multiple = FALSE)
List of vectors (multiple = TRUE)
hostname_to_ip() Vector Vector (multiple = FALSE)
List of vectors (multiple = TRUE)
summarize_address_range() Vector List of vectors
subnets() Scalar Vector
seq.ip_network() Scalar Vector
hosts() Scalar Vector

This is a bit confusing, so I need to think about the underlying design principles here.

Release ipaddress 0.2.0

Prepare for release:

  • Check current CRAN check results
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • rhub::check(platform = 'solaris-x86-patched')
  • rhub::check(platform = 'ubuntu-rchk')
  • rhub::check_with_sanitizers()
  • Update cran-comments.md
  • Polish NEWS

Submit to CRAN:

  • usethis::use_version('minor')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version()

Release ipaddress 0.5.0

Prepare for release:

  • devtools::build_readme()
  • Check current CRAN check results
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • rhub::check(platform = 'solaris-x86-patched')
  • rhub::check(platform = 'ubuntu-rchk')
  • rhub::check_with_sanitizers()
  • Update cran-comments.md
  • Polish NEWS

Submit to CRAN:

  • usethis::use_version('minor')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version()

Compilation error on OSX with clang

Bug description

Over on conda-forge we're currently rebuilding our packages for R 4.3. The ipaddress package is throwing the following error on OSX under R 4.3. Can you advise?

x86_64-apple-darwin13.4.0-clang++ -std=gnu++17 -I"$PREFIX/lib/R/include" -DNDEBUG -I../inst/include/ -I'$PREFIX/lib/R/library/AsioHeaders/include' -I'$PREFIX/lib/R/library/Rcpp/include' -D_FORTIFY_SOURCE=2 -isystem $PREFIX/include -mmacosx-version-min=10.9 -I$PREFIX/include   -DASIO_STANDALONE -DASIO_NO_DEPRECATED -fPIC  -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -fmessage-length=0 -isystem $PREFIX/include -fdebug-prefix-map=/Users/runner/miniforge3/conda-bld/r-base-split_1684496426925/work=/usr/local/src/conda/r-base-4.3.0 -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix  -c ip_address.cpp -o ip_address.o
In file included from ip_address.cpp:2:
In file included from /Users/runner/miniforge3/conda-bld/r-ipaddress_1687141681389/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib/R/library/AsioHeaders/include/asio/ip/address_v4.hpp:352:
In file included from /Users/runner/miniforge3/conda-bld/r-ipaddress_1687141681389/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib/R/library/AsioHeaders/include/asio/ip/impl/address_v4.ipp:23:
In file included from /Users/runner/miniforge3/conda-bld/r-ipaddress_1687141681389/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib/R/library/AsioHeaders/include/asio/detail/socket_ops.hpp:21:
/Users/runner/miniforge3/conda-bld/r-ipaddress_1687141681389/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib/R/library/AsioHeaders/include/asio/detail/memory.hpp:88:20: error: reference to unresolved using declaration
  void* ptr = std::aligned_alloc(align, size);
                   ^
/Users/runner/miniforge3/conda-bld/r-ipaddress_1687141681389/_build_env/bin/../include/c++/v1/cstdlib:148:1: note: using declaration annotated with 'using_if_exists' here
using ::aligned_alloc _LIBCPP_USING_IF_EXISTS;
^
In file included from ip_address.cpp:2:
In file included from /Users/runner/miniforge3/conda-bld/r-ipaddress_1687141681389/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib/R/library/AsioHeaders/include/asio/ip/address_v4.hpp:352:
In file included from /Users/runner/miniforge3/conda-bld/r-ipaddress_1687141681389/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib/R/library/AsioHeaders/include/asio/ip/impl/address_v4.ipp:23:
In file included from /Users/runner/miniforge3/conda-bld/r-ipaddress_1687141681389/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib/R/library/AsioHeaders/include/asio/detail/socket_ops.hpp:21:
/Users/runner/miniforge3/conda-bld/r-ipaddress_1687141681389/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib/R/library/AsioHeaders/include/asio/detail/memory.hpp:88:15: error: excess elements in scalar initializer
  void* ptr = std::aligned_alloc(align, size);
              ^                       ~~~~~~
2 errors generated.

Additional context

OSX

Xref: conda-forge/r-ipaddress-feedstock#15

Release ipaddress 0.5.5

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • rhub::check(platform = 'ubuntu-rchk')
  • rhub::check_with_sanitizers()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • git push

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • git push
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • git push

Release ipaddress 0.5.3

Prepare for release:

  • Check current CRAN check results
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • rhub::check(platform = 'ubuntu-rchk')
  • rhub::check_with_sanitizers()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version()

Extract networks from `country_networks()` output

First, thank you for developing this package!

Bug description

How do you extract the networks from country_networks() output in a way that ip_networks() will properly parse them? The output of country_networks() is a list, which ip_networks() cannot parse. When I unlist() the output, it transforms out of IP network format. I'm sure I'm missing something simple, but how do I access the networks?

To Reproduce

Reproducible example:

library(ipaddress)

ip_to <- country_networks("TO")
ip_to$networks
#> <list_of<ip_network>[1]>
#> [[1]]
#> <ip_network[16]>
#>  [1] 43.255.148.0/22    103.54.78.0/23     103.124.187.0/24   103.134.118.0/23  
#>  [5] 103.154.96.0/23    103.239.160.0/22   103.242.126.0/23   103.245.160.0/22  
#>  [9] 175.176.144.0/21   202.43.8.0/21      202.134.24.0/21    2001:df4:7480::/48
#> [13] 2400:6400::/32     2400:80e0::/32     2402:1940::/32     2406:1500::/32
ip_network(ip_to$networks)
#> Error in wrap_parse_network(x, strict, FALSE): Not compatible with STRSXP: [type=list].
unlist(ip_to$networks)
#>  address11  address12  address13  address14  address15  address16  address17 
#>    9764651    5125735   12287079    7767655    6330983   10547047    8319591 
#>  address18  address19 address110 address111 address112 address113 address114 
#>   10548583    9482415     535498    1607370 -200474336    6553636 -528482268 
#> address115 address116  address21  address22  address23  address24  address25 
#> 1075380772    1377828          0          0          0          0          0 
#>  address26  address27  address28  address29 address210 address211 address212 
#>          0          0          0          0          0          0      32884 
#> address213 address214 address215 address216  address31  address32  address33 
#>          0          0          0          0          0          0          0 
#>  address34  address35  address36  address37  address38  address39 address310 
#>          0          0          0          0          0          0          0 
#> address311 address312 address313 address314 address315 address316  address41 
#>          0          0          0          0          0          0          0 
#>  address42  address43  address44  address45  address46  address47  address48 
#>          0          0          0          0          0          0          0 
#>  address49 address410 address411 address412 address413 address414 address415 
#>          0          0          0          0          0          0          0 
#> address416    prefix1    prefix2    prefix3    prefix4    prefix5    prefix6 
#>          0         22         23         24         23         23         22 
#>    prefix7    prefix8    prefix9   prefix10   prefix11   prefix12   prefix13 
#>         23         22         21         21         21         48         32 
#>   prefix14   prefix15   prefix16   is_ipv61   is_ipv62   is_ipv63   is_ipv64 
#>         32         32         32          0          0          0          0 
#>   is_ipv65   is_ipv66   is_ipv67   is_ipv68   is_ipv69  is_ipv610  is_ipv611 
#>          0          0          0          0          0          0          0 
#>  is_ipv612  is_ipv613  is_ipv614  is_ipv615  is_ipv616 
#>          1          1          1          1          1
ip_network(unlist(ip_to$networks))
#> Warning: Problem on row 1: 9764651
#> Warning: Problem on row 2: 5125735
#> Warning: Problem on row 3: 12287079
#> Warning: Problem on row 4: 7767655
#> Warning: Problem on row 5: 6330983
#> Warning: Problem on row 6: 10547047
#> Warning: Problem on row 7: 8319591
#> Warning: Problem on row 8: 10548583
#> Warning: Problem on row 9: 9482415
#> Warning: Problem on row 10: 535498
#> Warning: Problem on row 11: 1607370
#> Warning: Problem on row 12: -200474336
#> Warning: Problem on row 13: 6553636
#> Warning: Problem on row 14: -528482268
#> Warning: Problem on row 15: 1075380772
#> Warning: Problem on row 16: 1377828
#> Warning: Problem on row 17: 0
#> Warning: Problem on row 18: 0
#> Warning: Problem on row 19: 0
#> Warning: Problem on row 20: 0
#> Warning: Problem on row 21: 0
#> Warning: Problem on row 22: 0
#> Warning: Problem on row 23: 0
#> Warning: Problem on row 24: 0
#> Warning: Problem on row 25: 0
#> Warning: Problem on row 26: 0
#> Warning: Problem on row 27: 0
#> Warning: Problem on row 28: 32884
#> Warning: Problem on row 29: 0
#> Warning: Problem on row 30: 0
#> Warning: Problem on row 31: 0
#> Warning: Problem on row 32: 0
#> Warning: Problem on row 33: 0
#> Warning: Problem on row 34: 0
#> Warning: Problem on row 35: 0
#> Warning: Problem on row 36: 0
#> Warning: Problem on row 37: 0
#> Warning: Problem on row 38: 0
#> Warning: Problem on row 39: 0
#> Warning: Problem on row 40: 0
#> Warning: Problem on row 41: 0
#> Warning: Problem on row 42: 0
#> Warning: Problem on row 43: 0
#> Warning: Problem on row 44: 0
#> Warning: Problem on row 45: 0
#> Warning: Problem on row 46: 0
#> Warning: Problem on row 47: 0
#> Warning: Problem on row 48: 0
#> Warning: Problem on row 49: 0
#> Warning: Problem on row 50: 0
#> Warning: Problem on row 51: 0
#> Warning: Problem on row 52: 0
#> Warning: Problem on row 53: 0
#> Warning: Problem on row 54: 0
#> Warning: Problem on row 55: 0
#> Warning: Problem on row 56: 0
#> Warning: Problem on row 57: 0
#> Warning: Problem on row 58: 0
#> Warning: Problem on row 59: 0
#> Warning: Problem on row 60: 0
#> Warning: Problem on row 61: 0
#> Warning: Problem on row 62: 0
#> Warning: Problem on row 63: 0
#> Warning: Problem on row 64: 0
#> Warning: Problem on row 65: 22
#> Warning: Problem on row 66: 23
#> Warning: Problem on row 67: 24
#> Warning: Problem on row 68: 23
#> Warning: Problem on row 69: 23
#> Warning: Problem on row 70: 22
#> Warning: Problem on row 71: 23
#> Warning: Problem on row 72: 22
#> Warning: Problem on row 73: 21
#> Warning: Problem on row 74: 21
#> Warning: Problem on row 75: 21
#> Warning: Problem on row 76: 48
#> Warning: Problem on row 77: 32
#> Warning: Problem on row 78: 32
#> Warning: Problem on row 79: 32
#> Warning: Problem on row 80: 32
#> Warning: Problem on row 81: 0
#> Warning: Problem on row 82: 0
#> Warning: Problem on row 83: 0
#> Warning: Problem on row 84: 0
#> Warning: Problem on row 85: 0
#> Warning: Problem on row 86: 0
#> Warning: Problem on row 87: 0
#> Warning: Problem on row 88: 0
#> Warning: Problem on row 89: 0
#> Warning: Problem on row 90: 0
#> Warning: Problem on row 91: 0
#> Warning: Problem on row 92: 1
#> Warning: Problem on row 93: 1
#> Warning: Problem on row 94: 1
#> Warning: Problem on row 95: 1
#> Warning: Problem on row 96: 1
#> <ip_network[96]>
#>  [1] <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
#> [16] <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
#> [31] <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
#> [46] <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
#> [61] <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
#> [76] <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
#> [91] <NA> <NA> <NA> <NA> <NA> <NA>

Created on 2023-02-11 with reprex v2.0.2```

Additional context

I'm using {ipaddress} v1.0.0, R version 4.2.2 Patched (2022-11-10 r83330), Ubuntu 22.04.1 LTS

Release ipaddress 1.0.1

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • git push

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • git push
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • git push

Release ipaddress 1.0.0

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Check if any deprecation processes should be advanced, as described in Gradual deprecation
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • git push

Submit to CRAN:

  • usethis::use_version('major')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • git push
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • git push

Error from fuzzyjoin in example vignette

Bug description

Using the example found in the vignette here I received the following error when executing the fuzzyjoin:

Error: Column col can't be used as a grouping variable because it's a ip_address/vctrs_rcrd/vctrs_vctr

To Reproduce

See <https://cran.r-project.org/web/packages/ipaddress/vignettes/ipaddress-examples.html>

Additional context

I'm using ipaddress 0.5.1 and fuzzjoin 0.1.6. and R version 3.5.3.

Why are CRAN binaries so big?

Three platforms are issuing the same NOTE in the CRAN check results. These platforms are:

  • r-devel-linux-x86_64-fedora-clang
  • r-release-macos-x86_64
  • r-oldrel-macos-x86_64

The NOTEs look like (with deviations on the exact size):

installed size is 9.7Mb
sub-directories of 1Mb or more:
libs 9.3Mb 

I found this confusing because the ipaddress.so file is pretty small when developing on my local machine (806 KB).

Downloading one of the binaries, I saw that the libs/ directory contains 2 files: ipaddress.so (850 KB) and ipaddress.so.dSYM (6 MB). This second file contains debugging symbols and is clearly driving the large size of the binaries.

Reading online, apparently debug symbol files can get very large when templates are used extensively (as in ipaddress).

ipv6 to ipv4 is NA

I can't seem to get any ip6's to convert to ip4's using the function extract_ipv4_mapped or extract_6to4. They all return NA. What am I doing wrong here?

ip_address('2603:8080:e00:991:bdd6:d257:4a2d:c430')

<ip_address[1]>
[1] 2603:8080:e00:991:bdd6:d257:4a2d:c430

ipaddress::extract_6to4(ip_address('2603:8080:e00:991:bdd6:d257:4a2d:c430'))
<ip_address[1]>
[1] <NA>


ipaddress::extract_ipv4_mapped(ip_address('2603:8080:e00:991:bdd6:d257:4a2d:c430'))
<ip_address[1]>
[1] <NA>

ip_address('2605:a601:ab6a:1300:9c9c:13fd:bf6b:4e7a')
<ip_address[1]>
[1] 2605:a601:ab6a:1300:9c9c:13fd:bf6b:4e7a

extract_6to4(ip_address('2605:a601:ab6a:1300:9c9c:13fd:bf6b:4e7a'))
<ip_address[1]>
[1] <NA>

This is on Windows 11, using R 4.2.3. None of the ip6's i've tried to convert are working.

Weighted sampling from multiple networks

The sample_ipv4(), sample_ipv6() and sample_network() functions support sampling addresses from a single network. When sampling from multiple networks, the current advice is to use an accept-reject algorithm. This is fine for generating IPv4 public addresses (~87% acceptance), but is computationally inefficient when the acceptance is low.

We could add a new function (or adjust sample_network()) to sample from a list of networks. By default, these networks would be sampled according to their size. But we could also allow the user to specify weightings.

Release ipaddress 0.4.0

Prepare for release:

  • devtools::build_readme()
  • Check current CRAN check results
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • rhub::check(platform = 'solaris-x86-patched')
  • Update cran-comments.md
  • Polish NEWS

Submit to CRAN:

  • usethis::use_version('minor')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version()

Release ipaddress 0.5.6

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • git push

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • git push
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • git push

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.