Skip to content

Commit

Permalink
Merge branch 'main' into move-vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
ntamas committed Jan 27, 2023
2 parents cb31968 + 9388dde commit f2bb0ef
Show file tree
Hide file tree
Showing 209 changed files with 3,907 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@
^codecov\.yml$
^\.gitattributes$
^build$
^_pkgdown\.yml$
^docs$
^pkgdown$
^\.github$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
12 changes: 12 additions & 0 deletions .github/workflows/fledge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,20 @@ concurrency:
cancel-in-progress: true

jobs:
check_fork:
runs-on: ubuntu-latest
outputs:
is_forked: ${{ steps.check.outputs.is_forked }}
steps:
- name: Check if the repo is forked
id: check
run: |
echo "is_forked=$(curl -s -H "Accept: application/vnd.github+json" -H 'Authorization: Bearer ${{ github.token }}' -H "X-GitHub-Api-Version: 2022-11-28" ${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY} | jq .fork)" >> $GITHUB_OUTPUT
fledge:
runs-on: ubuntu-latest
needs: check_fork
if: needs.check_fork.outputs.is_forked == 'false'
permissions:
contents: write
env:
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master, config-draft]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown

jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
clean: false
branch: gh-pages
folder: docs
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: igraph
Version: 1.3.5.9100
Version: 1.3.5.9104
Title: Network Analysis and Visualization
Author: See AUTHORS file.
Maintainer: Tamás Nepusz <ntamas@gmail.com>
Expand Down
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,6 @@ export(path.length.hist)
export(permute)
export(permute.vertices)
export(piecewise.layout)
export(plot.igraph)
export(plotHierarchy)
export(plot_dendrogram)
export(plot_hierarchy)
Expand All @@ -715,7 +714,6 @@ export(power_centrality)
export(predict_edges)
export(pref)
export(preference.game)
export(print.igraph)
export(print_all)
export(printer_callback)
export(r_pal)
Expand Down
32 changes: 32 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
<!-- NEWS.md is maintained by https://cynkra.github.io/fledge, do not edit -->

# igraph 1.3.5.9104

- Merge pull request #652 from wael-sadek/f-check-if-forked.

skip fledge job if the repo is a fork


# igraph 1.3.5.9103

## Bug fixes

- Iterators created with `E(P = ...)` or `E(path = ...)` are incomplete (#648).


# igraph 1.3.5.9102

## Chore

- Avoid fledge workflow on forks.


# igraph 1.3.5.9101

## Documentation

- Link to installation troubleshooting info (@maelle, #646).

- Further polish print_all() docs.

- Clarify print_all() output.


# igraph 1.3.5.9100

## Chore
Expand Down
1 change: 1 addition & 0 deletions R/adjacency.R
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,6 @@ graph_from_adjacency_matrix <- function(adjmatrix,

#' @rdname graph_from_adjacency_matrix
#' @param ... Passed to `graph_from_adjacency_matrix()`.
#' @family adjacency
#' @export
from_adjacency <- function(...) constructor_spec(graph_from_adjacency_matrix, ...)
2 changes: 2 additions & 0 deletions R/bipartite.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
#' default it will be removed.
#' @return A list of two undirected graphs. See details above.
#' @author Gabor Csardi \email{csardi.gabor@@gmail.com}
#' @family bipartite
#' @export
#' @keywords graphs
#' @examples
Expand Down Expand Up @@ -190,5 +191,6 @@ bipartite_projection <- function(graph, types = NULL,
#' g3 <- make_ring(10)
#' g3 <- add_edges(g3, c(1, 3))
#' bipartite_mapping(g3)
#' @family bipartite
#' @export
bipartite_mapping <- bipartite_mapping
17 changes: 17 additions & 0 deletions R/centrality.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#' calculated.
#' @param cutoff The maximum path length to consider when calculating the
#' betweenness. If zero or negative then there is no such limit.
#' @family centrality
#' @export
estimate_betweenness <- function(graph, vids = V(graph), directed = TRUE, cutoff, weights = NULL, nobigint = TRUE) {
if (!missing(nobigint)) {
Expand Down Expand Up @@ -105,6 +106,7 @@ estimate_betweenness <- function(graph, vids = V(graph), directed = TRUE, cutoff
#'
#' Ulrik Brandes, A Faster Algorithm for Betweenness Centrality. *Journal
#' of Mathematical Sociology* 25(2):163-177, 2001.
#' @family centrality
#' @export
#' @keywords graphs
#' @examples
Expand Down Expand Up @@ -154,6 +156,7 @@ betweenness <- function(graph, v = V(graph), directed = TRUE, weights = NULL,

#' @rdname betweenness
#' @param e The edges for which the edge betweenness will be calculated.
#' @family centrality
#' @export
edge_betweenness <- function(graph, e = E(graph),
directed = TRUE, weights = NULL, cutoff = -1) {
Expand Down Expand Up @@ -183,6 +186,7 @@ edge_betweenness <- function(graph, e = E(graph),
res[as.numeric(e)]
}

#' @family centrality
#' @export
estimate_edge_betweenness <- function(graph, e = E(graph),
directed = TRUE, cutoff, weights = NULL) {
Expand Down Expand Up @@ -242,6 +246,7 @@ estimate_edge_betweenness <- function(graph, e = E(graph),
#' @seealso [betweenness()], [degree()], [harmonic_centrality()]
#' @references Freeman, L.C. (1979). Centrality in Social Networks I:
#' Conceptual Clarification. *Social Networks*, 1, 215-239.
#' @family centrality
#' @export
#' @keywords graphs
#' @examples
Expand Down Expand Up @@ -291,12 +296,14 @@ closeness <- function(graph, vids = V(graph),
res
}

#' @family centrality
#' @export
estimate_closeness <- function(graph, vids = V(graph), mode = c("out", "in", "all", "total"), cutoff, weights = NULL, normalized = FALSE) {
closeness(graph, vids, mode = mode, weights = weights, normalized = normalized, cutoff = cutoff)
}

#' @rdname arpack
#' @family centrality
#' @export
arpack_defaults <- list(
bmat = "I", n = 0, which = "XX", nev = 1, tol = 0.0,
Expand Down Expand Up @@ -490,6 +497,7 @@ arpack_defaults <- list(
#' which = "LM", maxiter = 2000
#' ))
#' }
#' @family centrality
#' @export
arpack <- function(func, extra = NULL, sym = FALSE, options = arpack_defaults,
env = parent.frame(), complex = !sym) {
Expand Down Expand Up @@ -588,6 +596,7 @@ arpack.unpack.complex <- function(vectors, values, nev) {
#' @seealso [eigen_centrality()], [page_rank()]
#' @references Ernesto Estrada, Juan A. Rodriguez-Velazquez: Subgraph
#' centrality in Complex Networks. *Physical Review E* 71, 056103 (2005).
#' @family centrality
#' @export
#' @keywords graphs
#' @examples
Expand Down Expand Up @@ -668,6 +677,7 @@ subgraph_centrality <- function(graph, diag = FALSE) {
#' ## Smallest eigenvalues
#' spectrum(kite, which = list(pos = "SM", howmany = 2))$values
#'
#' @family centrality
#' @export
spectrum <- spectrum

Expand Down Expand Up @@ -760,6 +770,7 @@ eigen_defaults <- list(
#' g <- make_ring(10, directed = FALSE)
#' # Compute eigenvector centrality scores
#' eigen_centrality(g)
#' @family centrality
#' @export
eigen_centrality <- eigen_centrality

Expand Down Expand Up @@ -798,6 +809,7 @@ eigen_centrality <- eigen_centrality
#' # No weights, a warning is given
#' g <- make_ring(10)
#' strength(g)
#' @family centrality
#' @export
strength <- strength

Expand Down Expand Up @@ -841,6 +853,7 @@ strength <- strength
#' diversity(g1)
#' diversity(g2)
#' diversity(g3)
#' @family centrality
#' @export
diversity <- diversity

Expand Down Expand Up @@ -1027,6 +1040,7 @@ authority_score <- authority_score
#' page_rank(g3)$vector
#' reset <- seq(vcount(g3))
#' page_rank(g3, personalized = reset)$vector
#' @family centrality
#' @export
page_rank <- page_rank

Expand Down Expand Up @@ -1063,6 +1077,7 @@ page_rank <- page_rank
#' @seealso [betweenness()], [closeness()]
#' @references M. Marchiori and V. Latora, Harmony in the small-world,
#' *Physica A* 285, pp. 539-546 (2000).
#' @family centrality
#' @export
#' @keywords graphs
#' @examples
Expand Down Expand Up @@ -1210,6 +1225,7 @@ bonpow.sparse <- function(graph, nodes = V(graph), loops = FALSE,
#' Bonacich, P. (1987). ``Power and Centrality: A Family of Measures.''
#' *American Journal of Sociology*, 92, 1170-1182.
#' @keywords graphs
#' @family centrality
#' @export
#' @examples
#'
Expand Down Expand Up @@ -1393,6 +1409,7 @@ alpha.centrality.sparse <- function(graph, nodes = V(graph), alpha = 1,
#' @references Bonacich, P. and Lloyd, P. (2001). ``Eigenvector-like
#' measures of centrality for asymmetric relations'' *Social Networks*,
#' 23, 191-201.
#' @family centrality
#' @export
#' @keywords graphs
#' @examples
Expand Down
11 changes: 11 additions & 0 deletions R/cliques.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
#' @references For maximal cliques the following algorithm is implemented:
#' David Eppstein, Maarten Loffler, Darren Strash: Listing All Maximal Cliques
#' in Sparse Graphs in Near-optimal Time. <https://arxiv.org/abs/1006.5440>
#' @family cliques
#' @export
#' @keywords graphs
#' @examples
Expand All @@ -89,6 +90,7 @@
#' max_cliques(g)
cliques <- cliques

#' @family cliques
#' @export
largest_cliques <- largest_cliques

Expand All @@ -103,6 +105,7 @@ largest_cliques <- largest_cliques
#' it exists, then it will be overwritten.) Each clique will be a separate line
#' in the file, given with the numeric ids of its vertices, separated by
#' whitespace.
#' @family cliques
#' @export
max_cliques <- function(graph, min = NULL, max = NULL, subset = NULL, file = NULL) {
if (!is_igraph(graph)) {
Expand Down Expand Up @@ -156,6 +159,7 @@ max_cliques <- function(graph, min = NULL, max = NULL, subset = NULL, file = NUL
}
}

#' @family cliques
#' @export
count_max_cliques <- function(graph, min = NULL, max = NULL,
subset = NULL) {
Expand Down Expand Up @@ -184,6 +188,7 @@ count_max_cliques <- function(graph, min = NULL, max = NULL,
res
}

#' @family cliques
#' @export
clique_num <- clique_num

Expand Down Expand Up @@ -236,6 +241,7 @@ clique_num <- clique_num
#' @author Tamas Nepusz \email{ntamas@@gmail.com} and Gabor Csardi
#' \email{csardi.gabor@@gmail.com}
#' @seealso [ivs()]
#' @family cliques
#' @export
#' @keywords graphs
#' @examples
Expand Down Expand Up @@ -299,6 +305,7 @@ weighted_clique_num <- weighted_clique_num
#' @references S. Tsukiyama, M. Ide, H. Ariyoshi and I. Shirawaka. A new
#' algorithm for generating all the maximal independent sets. *SIAM J
#' Computing*, 6:505--517, 1977.
#' @family cliques
#' @export
#' @keywords graphs
#' @examples
Expand Down Expand Up @@ -342,6 +349,7 @@ ivs <- function(graph, min = NULL, max = NULL) {
res
}

#' @family cliques
#' @export
largest_ivs <- function(graph) {
if (!is_igraph(graph)) {
Expand All @@ -359,6 +367,7 @@ largest_ivs <- function(graph) {
res
}

#' @family cliques
#' @export
maximal_ivs <- function(graph) {
if (!is_igraph(graph)) {
Expand All @@ -376,6 +385,7 @@ maximal_ivs <- function(graph) {
res
}

#' @family cliques
#' @export
ivs_size <- function(graph) {
if (!is_igraph(graph)) {
Expand All @@ -386,6 +396,7 @@ ivs_size <- function(graph) {
.Call(C_R_igraph_independence_number, graph)
}

#' @family cliques
#' @export
clique_size_counts <- function(graph, min = 0, max = 0, maximal = FALSE, ...) {
if (maximal) {
Expand Down
2 changes: 2 additions & 0 deletions R/cocitation.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#' `vcount(graph)` columns. Element `(i,j)` contains the cocitation
#' or bibliographic coupling for vertices `v[i]` and `j`.
#' @author Gabor Csardi \email{csardi.gabor@@gmail.com}
#' @family cocitation
#' @export
#' @keywords graphs
#' @examples
Expand All @@ -69,6 +70,7 @@ cocitation <- function(graph, v = V(graph)) {
res
}

#' @family cocitation
#' @export
bibcoupling <- function(graph, v = V(graph)) {
if (!is_igraph(graph)) {
Expand Down
Loading

0 comments on commit f2bb0ef

Please sign in to comment.