Skip to content

Commit

Permalink
Merge pull request #280 from snlab-ch/develop
Browse files Browse the repository at this point in the history
v1.1.5
  • Loading branch information
jhollway authored Nov 2, 2023
2 parents 96314c5 + 974ca7c commit 14f331d
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 73 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: migraph
Title: Multimodal Network Analysis and More
Version: 1.1.4
Date: 2023-11-01
Version: 1.1.5
Date: 2023-11-02
Description: A set of tools for analysing multimodal networks.
It includes functions for measuring
centrality, centralization, cohesion, closure, constraint and diversity,
Expand Down
12 changes: 12 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# migraph 1.1.5

2023-11-02

## Members

- Fixed documentation issue with `summary.node_member()`

## Motifs

- Fixed documentation issue with `node_census()`

# migraph 1.1.4

2023-11-01
Expand Down
28 changes: 13 additions & 15 deletions R/class_members.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,29 @@ print.node_member <- function(x, ..., n = NULL) {
summary.node_member <- function(object, ...,
n = 6,
digits = 3) {
if (any(attr(x, "mode"))) {
for (i in names(table(x))) {
if (i == names(table(x))[1]) cat(i, "\n")
if (any(attr(object, "mode"))) {
for (i in names(table(object))) {
if (i == names(table(object))[1]) cat(i, "\n")
else cat("\n", i, "\n")
if (!is.null(names(x))) {
y <- paste(names(x[x == i & attr(x, "mode")]), collapse = ", ")
z <- paste(names(x[x == i & !attr(x, "mode")]), collapse = ", ")
if (!is.null(names(object))) {
y <- paste(names(object[object == i & attr(object, "mode")]), collapse = ", ")
z <- paste(names(object[object == i & !attr(object, "mode")]), collapse = ", ")
} else {
y <- paste(which(x == i & attr(x, "mode")), collapse = ", ")
z <- paste(which(x == i & !attr(x, "mode")), collapse = ", ")
y <- paste(which(object == i & attr(object, "mode")), collapse = ", ")
z <- paste(which(object == i & !attr(object, "mode")), collapse = ", ")
}
cat(" ", y, "\n")
cat(" ", z)
}
} else {
for (i in names(table(x))) {
for (i in names(table(object))) {
cat(pillar::style_subtle(paste0("Class ", i, ":")))
# if (i == names(table(x))[1]) cat("Class ", i, ":", sep = "")
# else cat("Class ", i, ":", sep = "")
if (!is.null(names(x)))
y <- paste(names(x[x == i]), collapse = ", ")
if (!is.null(names(object)))
y <- paste(names(object[object == i]), collapse = ", ")
else
y <- paste(which(x == i), collapse = ", ")
y <- paste(which(object == i), collapse = ", ")
cat(" ", y)
if (i != names(table(x))[length(table(x))]) cat("\n")
if (i != names(table(object))[length(table(object))]) cat("\n")
}
}
}
Expand Down
62 changes: 31 additions & 31 deletions R/motif_census.R
Original file line number Diff line number Diff line change
Expand Up @@ -154,37 +154,37 @@ node_quad_census <- function(.data){
}
}

#' #' @export
#' node_bmotif_census <- function(.data, normalized = FALSE){
#' if (!("bmotif" %in% rownames(utils::installed.packages()))) {
#' message("Please install package `{bmotif}`.")
#' out <- bmotif::node_positions(manynet::as_matrix(.data),
#' weights_method = ifelse(manynet::is_weighted(.data),
#' 'mean_motifweights', 'none'),
#' normalisation = ifelse(normalized,
#' 'levelsize_NAzero', 'none'))
#' make_node_motif(out, .data)
#' }
#' }
#'
#' #' @export
#' node_igraph_census <- function(.data, normalized = FALSE){
#' out <- igraph::motifs(manynet::as_igraph(.data), 4)
#' if(manynet::is_labelled(.data))
#' rownames(out) <- manynet::node_names(.data)
#' colnames(out) <- c("co-K4",
#' "co-diamond",
#' "co-C4",
#' "co-paw",
#' "co-claw",
#' "P4",
#' "claw",
#' "paw",
#' "C4",
#' "diamond",
#' "K4")
#' make_node_motif(out, .data)
#' }
# #' @export
# node_bmotif_census <- function(.data, normalized = FALSE){
# if (!("bmotif" %in% rownames(utils::installed.packages()))) {
# message("Please install package `{bmotif}`.")
# out <- bmotif::node_positions(manynet::as_matrix(.data),
# weights_method = ifelse(manynet::is_weighted(.data),
# 'mean_motifweights', 'none'),
# normalisation = ifelse(normalized,
# 'levelsize_NAzero', 'none'))
# make_node_motif(out, .data)
# }
# }
#
# #' @export
# node_igraph_census <- function(.data, normalized = FALSE){
# out <- igraph::motifs(manynet::as_igraph(.data), 4)
# if(manynet::is_labelled(.data))
# rownames(out) <- manynet::node_names(.data)
# colnames(out) <- c("co-K4",
# "co-diamond",
# "co-C4",
# "co-paw",
# "co-claw",
# "P4",
# "claw",
# "paw",
# "C4",
# "diamond",
# "K4")
# make_node_motif(out, .data)
# }

#' @describeIn node_census Returns the shortest path lengths
#' of each node to every other node in the network.
Expand Down
12 changes: 6 additions & 6 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
## Test environments

* local R installation, x86_64-apple-darwin20, R 4.3.0
* Mac OS X 12.6.5 (on Github), R 4.3.0
* Microsoft Windows Server 2022 10.0.20348 (on Github), R 4.3.0
* Ubuntu 22.04.2 (on Github), R 4.3.0
* R-hub builder (https://builder.r-hub.io)
- Windows Server 2022 R-devel, 64 bit
* local R installation, x86_64-apple-darwin20, R 4.3.1
* Mac OS X 12.6.9 (on Github), R 4.3.2
* Microsoft Windows Server 2022 10.0.20348 (on Github), R 4.3.2
* Ubuntu 22.04.3 (on Github), R 4.3.2

## R CMD check results

0 errors | 0 warnings | 0 notes

- Fixed documentation issues from previous submission
19 changes: 0 additions & 19 deletions man/node_census.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 14f331d

Please sign in to comment.