From 486b9e4938ef28ec89cf354016e65545766499f6 Mon Sep 17 00:00:00 2001 From: James Hollway Date: Mon, 2 May 2022 15:12:30 +1200 Subject: [PATCH 1/2] Hotfix on create-release --- .github/workflows/pushrelease.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pushrelease.yml b/.github/workflows/pushrelease.yml index a8dfd205..30b060d9 100644 --- a/.github/workflows/pushrelease.yml +++ b/.github/workflows/pushrelease.yml @@ -102,12 +102,12 @@ jobs: uses: actions/checkout@v2 - name: Create Release id: create_release - uses: ncipollo/release-action@v1 + uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ steps.newtag.outputs.tag }} - name: Release ${{ steps.newtag.outputs.tag }} + release_name: Release ${{ steps.newtag.outputs.tag }} draft: false prerelease: false From eed5783ed434d1f85c2b32925622dcabf2df93c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Fri, 16 Jun 2023 12:00:40 +0200 Subject: [PATCH 2/2] replace igraph::estimate_closeness() with igraph::closeness() because of upcoming deprecation --- NAMESPACE | 1 + R/measure_centrality.R | 18 +++++++----------- R/migraph-package.R | 7 +++++++ man/migraph-package.Rd | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 11 deletions(-) create mode 100644 R/migraph-package.R create mode 100644 man/migraph-package.Rd diff --git a/NAMESPACE b/NAMESPACE index 4bc52125..1bbeb8bf 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -264,6 +264,7 @@ importFrom(network,as.network) importFrom(network,is.network) importFrom(purrr,flatten) importFrom(rlang,.data) +importFrom(rlang,`%||%`) importFrom(rlang,enquo) importFrom(rlang,eval_tidy) importFrom(sna,brokerage) diff --git a/R/measure_centrality.R b/R/measure_centrality.R index 4b37df63..175b1e6c 100644 --- a/R/measure_centrality.R +++ b/R/measure_centrality.R @@ -207,10 +207,10 @@ node_betweenness <- function(.data, normalized = TRUE, directed = manynet::is_directed(graph), weights = weights, normalized = normalized) } else { - out <- igraph::estimate_betweenness(graph = graph, vids = igraph::V(graph), - directed = manynet::is_directed(graph), - cutoff = cutoff, - weights = weights) + out <- igraph::betweenness(graph = graph, v = igraph::V(graph), + directed = manynet::is_directed(graph), + cutoff = cutoff, + weights = weights) } } out <- make_node_measure(out, .data) @@ -325,13 +325,9 @@ node_closeness <- function(.data, normalized = TRUE, set_size <- ifelse(igraph::V(graph)$type, sum(igraph::V(graph)$type), sum(!igraph::V(graph)$type)) out <- closeness/(1/(other_set_size+2*set_size-2)) } else { - if (is.null(cutoff)) { - out <- igraph::closeness(graph = graph, vids = igraph::V(graph), mode = direction, - weights = weights, normalized = normalized) - } else { - out <- igraph::estimate_closeness(graph = graph, vids = igraph::V(graph), mode = direction, - cutoff = cutoff, weights = weights, normalized = normalized) - } + cutoff <- cutoff %||% -1 + out <- igraph::closeness(graph = graph, vids = igraph::V(graph), mode = direction, + cutoff = cutoff, weights = weights, normalized = normalized) } out <- make_node_measure(out, .data) out diff --git a/R/migraph-package.R b/R/migraph-package.R new file mode 100644 index 00000000..4ffe2683 --- /dev/null +++ b/R/migraph-package.R @@ -0,0 +1,7 @@ +#' @importFrom rlang `%||%` +#' @keywords internal +"_PACKAGE" + +## usethis namespace: start +## usethis namespace: end +NULL diff --git a/man/migraph-package.Rd b/man/migraph-package.Rd new file mode 100644 index 00000000..894d9a50 --- /dev/null +++ b/man/migraph-package.Rd @@ -0,0 +1,32 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/migraph-package.R +\docType{package} +\name{migraph-package} +\alias{migraph} +\alias{migraph-package} +\title{migraph: Multimodal Network Analysis and More} +\description{ +\if{html}{\figure{logo.png}{options: style='float: right' alt='logo' width='120'}} + +A set of tools for analysing multimodal networks. All functions operate with matrices, edge lists, and 'igraph', 'network', and 'tidygraph' objects, and on one-mode, two-mode (bipartite), and sometimes three-mode networks. It includes functions for measuring centrality, centralization, cohesion, closure, and constraint, as well as for network block-modelling, regression, and diffusion models. The package is released as a complement to 'Multimodal Political Networks' (2021, ISBN:9781108985000), and includes various datasets used in the book in addition to other network data. +} +\seealso{ +Useful links: +\itemize{ + \item \url{https://github.com/snlab-ch/migraph} + \item Report bugs at \url{https://github.com/snlab-ch/migraph/issues} +} + +} +\author{ +\strong{Maintainer}: James Hollway \email{james.hollway@graduateinstitute.ch} (\href{https://orcid.org/0000-0002-8361-9647}{ORCID}) (IHEID) [contributor] + +Other contributors: +\itemize{ + \item Henrique Sposito (\href{https://orcid.org/0000-0003-3420-6085}{ORCID}) (IHEID) [contributor] + \item Jael Tan \email{jael.tan@graduateinstitute.ch} (\href{https://orcid.org/0000-0002-6234-9764}{ORCID}) (IHEID) [contributor] + \item Bernhard Bieri \email{bernhard.bieri@graduateinstitute.ch} (\href{https://orcid.org/0000-0001-5943-9059}{ORCID}) [contributor] +} + +} +\keyword{internal}