Site icon R-bloggers

oaqc: Orbit aware quad census package back on CRAN

[This article was first published on schochastics - all things R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

This is just a short announcement post that the R package oaqc is back on CRAN.

The package provides an efficient algorithm to calculate for a given graph the orbit-aware quad census. More precisely the frequency distribution of all induced and non-induced non-isomorphic four node subgraphs, i.e. quads, on a node and edge level; see the figure below for the relation between orbit and quad.

The package was archived because the original authors were not reachable anymore. I tracked them down and got their permission to maintain the package.

The new GitHub repository is https://github.com/schochastics/oaqc. Most importantly, the package now also has a hexsticker

Below is a short example for how to use the package.

< section id="input" class="level2">

Input

The input can either be an edgelist (matrix or data.frame) or a graph Object (‘igraph’)

Despite the input format the graph should not contain loops or multi-edges and the vertex indices have to lie in range [0,n-1) with n denoting the number of vertices in the graph. Note that if the smallest index is 1 the algorithm will create an isolated vertex with index 0.

< section id="calculating-the-orbit-aware-quad-census" class="level2">

Calculating the orbit-aware quad census

The following code exemplifies the use of this package.

library(oaqc)
### k4, pure R
k4 <- data.frame(
    source = c(0, 0, 0, 1, 1, 2),
    target = c(1, 2, 3, 2, 3, 3)
)
k4orbits <- oaqc(k4, non_ind_freq = FALSE, file = "")
k4orbits
$n_orbits_ind
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,]    0    0    0    0    0    0    0    0    0     0     0     0     0     0
[2,]    0    0    0    0    0    0    0    0    0     0     0     0     0     0
[3,]    0    0    0    0    0    0    0    0    0     0     0     0     0     0
[4,]    0    0    0    0    0    0    0    0    0     0     0     0     0     0
     [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     1
[2,]     0     0     0     0     0     1
[3,]     0     0     0     0     0     1
[4,]     0     0     0     0     0     1

$e_orbits_ind
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,]    0    0    0    0    0    0    0    0    0     0     0     0     0     1
[2,]    0    0    0    0    0    0    0    0    0     0     0     0     0     1
[3,]    0    0    0    0    0    0    0    0    0     0     0     0     0     1
[4,]    0    0    0    0    0    0    0    0    0     0     0     0     0     1
[5,]    0    0    0    0    0    0    0    0    0     0     0     0     0     1
[6,]    0    0    0    0    0    0    0    0    0     0     0     0     0     1
< section class="quarto-appendix-contents" id="quarto-reuse">

Reuse

CC BY 4.0
< section class="quarto-appendix-contents" id="quarto-citation">

Citation

BibTeX citation:
@online{schoch2024,
  author = {Schoch, David},
  title = {Oaqc: {Orbit} Aware Quad Census Package Back on {CRAN}},
  date = {2024-10-07},
  url = {http://blog.schochastics.net/posts/2024-10-07_oaqc-back-on-cran/},
  langid = {en}
}
For attribution, please cite this work as:
Schoch, David. 2024. “Oaqc: Orbit Aware Quad Census Package Back on CRAN.” October 7, 2024. http://blog.schochastics.net/posts/2024-10-07_oaqc-back-on-cran/.
To leave a comment for the author, please follow the link and comment on their blog: schochastics - all things R.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Exit mobile version