diff --git a/R/attributes.R b/R/attributes.R index 961f8350bb1..1c0c7f7722e 100644 --- a/R/attributes.R +++ b/R/attributes.R @@ -34,6 +34,7 @@ ## + #' Graph attributes of a graph #' #' @param graph Input graph. @@ -174,11 +175,12 @@ vertex_attr <- function(graph, name, index = V(graph)) { } else { myattr <- .Call(C_R_igraph_mybracket2, graph, igraph_t_idx_attr, igraph_attr_idx_vertex)[[as.character(name)]] - if (!missing(index)) { + if (is_complete_iterator(index)) { + myattr + } else { index <- as.igraph.vs(graph, index) - myattr <- myattr[index] + myattr[index] } - myattr } } @@ -223,6 +225,7 @@ vertex_attr <- function(graph, name, index = V(graph)) { #' of a subset of vertices. #' @param value The new value of the attribute for all (or `index`) #' vertices. +#' If `NULL`, the input is returned unchanged. #' @return The graph, with the vertex attribute added or set. #' #' @aliases set.vertex.attribute @@ -235,31 +238,58 @@ vertex_attr <- function(graph, name, index = V(graph)) { #' g #' plot(g) set_vertex_attr <- function(graph, name, index = V(graph), value) { - i_set_vertex_attr( - graph = graph, name = name, index = index, - value = value - ) + if (is_complete_iterator(index)) { + i_set_vertex_attr(graph = graph, name = name, value = value, check = FALSE) + } else { + i_set_vertex_attr(graph = graph, name = name, index = index, value = value) + } } -i_set_vertex_attr <- function(graph, name, index = V(graph), value, - check = TRUE) { +i_set_vertex_attr <- function(graph, name, index = V(graph), value, check = TRUE) { if (!is_igraph(graph)) { stop("Not a graph object") } + + if (is.null(value)) { + return(graph) + } + single <- is_single_index(index) + complete <- is_complete_iterator(index) if (!missing(index) && check) { index <- as.igraph.vs(graph, index) } name <- as.character(name) - vc <- vcount(graph) vattrs <- .Call(C_R_igraph_mybracket2, graph, igraph_t_idx_attr, igraph_attr_idx_vertex) + + if (!complete && !(name %in% names(vattrs))) { + vattrs[[name]] <- value[rep.int(NA_integer_, vcount(graph))] + } + if (single) { vattrs[[name]][[index]] <- value } else { - vattrs[[name]][index] <- value + if (length(value) == 1) { + value_in <- rep(unname(value), length(index)) + } else if (length(value) == length(index)) { + value_in <- unname(value) + } else { + stop( + "Length of new attribute value must be ", + if (length(index) != 1) "1 or ", + length(index), + ", the number of target vertices, not ", + length(value) + ) + } + + if (complete) { + vattrs[[name]] <- value_in + } else { + vattrs[[name]][index] <- value_in + } } - length(vattrs[[name]]) <- vc .Call(C_R_igraph_mybracket2_set, graph, igraph_t_idx_attr, igraph_attr_idx_vertex, vattrs) } @@ -355,7 +385,7 @@ edge_attr <- function(graph, name, index = E(graph)) { } else { name <- as.character(name) myattr <- .Call(C_R_igraph_mybracket2, graph, igraph_t_idx_attr, igraph_attr_idx_edge)[[name]] - if (is.null(index)) { + if (is_complete_iterator(index)) { myattr } else { index <- as.igraph.es(graph, index) @@ -405,6 +435,7 @@ edge_attr <- function(graph, name, index = E(graph)) { #' a subset of edges. #' @param value The new value of the attribute for all (or `index`) #' edges. +#' If `NULL`, the input is returned unchanged. #' @return The graph, with the edge attribute added or set. #' #' @aliases set.edge.attribute @@ -417,26 +448,58 @@ edge_attr <- function(graph, name, index = E(graph)) { #' g #' plot(g) set_edge_attr <- function(graph, name, index = E(graph), value) { - i_set_edge_attr(graph = graph, name = name, index = index, value = value) + if (is_complete_iterator(index)) { + i_set_edge_attr(graph = graph, name = name, value = value, check = FALSE) + } else { + i_set_edge_attr(graph = graph, name = name, index = index, value = value) + } } -i_set_edge_attr <- function(graph, name, index = E(graph), value, - check = TRUE) { +i_set_edge_attr <- function(graph, name, index = E(graph), value, check = TRUE) { if (!is_igraph(graph)) { stop("Not a graph object") } + + if (is.null(value)) { + return(graph) + } + + complete <- is_complete_iterator(index) single <- is_single_index(index) name <- as.character(name) - if (!missing(index) && check) index <- as.igraph.es(graph, index) - ec <- ecount(graph) + if (!missing(index) && check) { + index <- as.igraph.es(graph, index) + } eattrs <- .Call(C_R_igraph_mybracket2, graph, igraph_t_idx_attr, igraph_attr_idx_edge) + + if (!complete && !(name %in% names(eattrs))) { + eattrs[[name]] <- value[rep.int(NA_integer_, ecount(graph))] + } + if (single) { eattrs[[name]][[index]] <- value } else { - eattrs[[name]][index] <- value + if (length(value) == 1) { + value_in <- rep(unname(value), length(index)) + } else if (length(value) == length(index)) { + value_in <- unname(value) + } else { + stop( + "Length of new attribute value must be ", + if (length(index) != 1) "1 or ", + length(index), + ", the number of target edges, not ", + length(value) + ) + } + + if (complete) { + eattrs[[name]] <- value_in + } else { + eattrs[[name]][index] <- value_in + } } - length(eattrs[[name]]) <- ec .Call(C_R_igraph_mybracket2_set, graph, igraph_t_idx_attr, igraph_attr_idx_edge, eattrs) } diff --git a/R/conversion.R b/R/conversion.R index 9b87b307c88..b8bc17cf321 100644 --- a/R/conversion.R +++ b/R/conversion.R @@ -1047,7 +1047,7 @@ as_long_data_frame <- function(graph) { #' as.matrix(g, "adjacency") #' as.matrix(g, "edgelist") #' # use edge attribute "weight" -#' E(g)$weight <- rep(1:10, each = ecount(g)) +#' E(g)$weight <- rep(1:10, length.out = ecount(g)) #' as.matrix(g, "adjacency", sparse = FALSE, attr = "weight") #' as.matrix.igraph <- function(x, matrix.type = c("adjacency", "edgelist"), ...) { diff --git a/R/interface.R b/R/interface.R index 387f8f114e1..6b9d5c3cd31 100644 --- a/R/interface.R +++ b/R/interface.R @@ -84,12 +84,14 @@ add_edges <- function(graph, edges, ..., attr = list()) { idx <- numeric() } - eattrs <- .Call(C_R_igraph_mybracket2, graph, igraph_t_idx_attr, igraph_attr_idx_edge) for (i in seq(attrs)) { - eattrs[[nam[i]]][idx] <- attrs[[nam[i]]] + attr <- attrs[[nam[i]]] + if (!is.null(attr)) { + graph <- set_edge_attr(graph, nam[[i]], idx, attr) + } } - .Call(C_R_igraph_mybracket2_set, graph, igraph_t_idx_attr, igraph_attr_idx_edge, eattrs) + graph } #' Add vertices to a graph @@ -148,12 +150,14 @@ add_vertices <- function(graph, nv, ..., attr = list()) { idx <- numeric() } - vattrs <- .Call(C_R_igraph_mybracket2, graph, igraph_t_idx_attr, igraph_attr_idx_vertex) for (i in seq(attrs)) { - vattrs[[nam[i]]][idx] <- attrs[[nam[i]]] + attr <- attrs[[nam[i]]] + if (!is.null(attr)) { + graph <- set_vertex_attr(graph, nam[[i]], idx, attr) + } } - .Call(C_R_igraph_mybracket2_set, graph, igraph_t_idx_attr, igraph_attr_idx_vertex, vattrs) + graph } #' Delete edges from a graph diff --git a/R/iterators.R b/R/iterators.R index daa379fe6da..c5cae425fec 100644 --- a/R/iterators.R +++ b/R/iterators.R @@ -317,6 +317,7 @@ E <- function(graph, P = NULL, path = NULL, directed = TRUE) { if (is.null(P) && is.null(path)) { ec <- ecount(graph) res <- seq_len(ec) + res <- set_complete_iterator(res) } else if (!is.null(P)) { on.exit(.Call(C_R_igraph_finalizer)) res <- .Call( @@ -340,7 +341,6 @@ E <- function(graph, P = NULL, path = NULL, directed = TRUE) { } class(res) <- "igraph.es" - res <- set_complete_iterator(res) add_vses_graph_ref(res, graph) } diff --git a/R/structural.properties.R b/R/structural.properties.R index 73a52370f16..6d30af7d3d5 100644 --- a/R/structural.properties.R +++ b/R/structural.properties.R @@ -2118,7 +2118,7 @@ laplacian_matrix <- function(graph, normalized = FALSE, weights = NULL, #' is_max_matching(g, m2) #' is_max_matching(g, m3) #' -#' V(g)$type <- c(FALSE, TRUE) +#' V(g)$type <- rep(c(FALSE, TRUE), 3) #' print_all(g, v = TRUE) #' max_bipartite_match(g) #' diff --git a/man/as.matrix.igraph.Rd b/man/as.matrix.igraph.Rd index ce464f127a3..c5d97a978f4 100644 --- a/man/as.matrix.igraph.Rd +++ b/man/as.matrix.igraph.Rd @@ -41,7 +41,7 @@ g <- make_graph("zachary") as.matrix(g, "adjacency") as.matrix(g, "edgelist") # use edge attribute "weight" -E(g)$weight <- rep(1:10, each = ecount(g)) +E(g)$weight <- rep(1:10, length.out = ecount(g)) as.matrix(g, "adjacency", sparse = FALSE, attr = "weight") } diff --git a/man/matching.Rd b/man/matching.Rd index f7396ce136a..6a4ff586073 100644 --- a/man/matching.Rd +++ b/man/matching.Rd @@ -103,7 +103,7 @@ is_max_matching(g, m1) is_max_matching(g, m2) is_max_matching(g, m3) -V(g)$type <- c(FALSE, TRUE) +V(g)$type <- rep(c(FALSE, TRUE), 3) print_all(g, v = TRUE) max_bipartite_match(g) diff --git a/man/set_edge_attr.Rd b/man/set_edge_attr.Rd index f38529fddba..8dac8f8fff9 100644 --- a/man/set_edge_attr.Rd +++ b/man/set_edge_attr.Rd @@ -16,7 +16,8 @@ set_edge_attr(graph, name, index = E(graph), value) a subset of edges.} \item{value}{The new value of the attribute for all (or \code{index}) -edges.} +edges. +If \code{NULL}, the input is returned unchanged.} } \value{ The graph, with the edge attribute added or set. diff --git a/man/set_vertex_attr.Rd b/man/set_vertex_attr.Rd index 617b83af9af..38ba253b9ec 100644 --- a/man/set_vertex_attr.Rd +++ b/man/set_vertex_attr.Rd @@ -16,7 +16,8 @@ set_vertex_attr(graph, name, index = V(graph), value) of a subset of vertices.} \item{value}{The new value of the attribute for all (or \code{index}) -vertices.} +vertices. +If \code{NULL}, the input is returned unchanged.} } \value{ The graph, with the vertex attribute added or set. diff --git a/revdep/README.md b/revdep/README.md index 0d231dbdf25..4bd01ab14be 100644 --- a/revdep/README.md +++ b/revdep/README.md @@ -1,24 +1,19 @@ # Revdeps -## Failed to check (9) - -|package |version |error |warning |note | -|:---------|:-------|:-----|:-------|:----| -|DRviaSPCN |? | | | | -|genekitr |? | | | | -|immcp |? | | | | -|numbat |? | | | | -|Platypus |? | | | | -|NA |? | | | | -|tidySEM |? | | | | -|vivid |? | | | | -|NA |? | | | | - -## New problems (3) +## New problems (12) |package |version |error |warning |note | |:------------|:-------|:------|:-------|:----| -|[causaleffect](problems.md#causaleffect)|1.3.15 |__+1__ |1 | | -|[R6causal](problems.md#r6causal)|0.7.0 | |__+1__ | | +|[backbone](problems.md#backbone)|2.1.1 |__+1__ | | | +|[deepdep](problems.md#deepdep)|0.4.1 |__+1__ | | | +|[egor](problems.md#egor)|1.22.12 |__+1__ | | | +|[GREMLINS](problems.md#gremlins)|0.2.0 |__+1__ |__+1__ |1 | +|[incidentally](problems.md#incidentally)|1.0.1 | |__+1__ | | +|[mstknnclust](problems.md#mstknnclust)|0.3.1 | |__+1__ | | +|[nat](problems.md#nat)|1.8.19 |__+1__ |1 | | +|[netmeta](problems.md#netmeta)|2.7-0 |__+1__ | |1 | +|[NetOrigin](problems.md#netorigin)|1.1-4 |__+1__ | | | +|[poppr](problems.md#poppr)|2.9.3 |__+1__ |1 |1 | |[sfnetworks](problems.md#sfnetworks)|0.6.1 |__+1__ | | | +|[signnet](problems.md#signnet)|1.0.0 |__+1__ | |1 | diff --git a/revdep/cran.md b/revdep/cran.md index 663321bf57c..793c3275f52 100644 --- a/revdep/cran.md +++ b/revdep/cran.md @@ -1,30 +1,49 @@ ## revdepcheck results -We checked 752 reverse dependencies (750 from CRAN + 2 from Bioconductor), comparing R CMD check results across CRAN and dev versions of this package. +We checked 12 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. - * We saw 3 new problems - * We failed to check 7 packages + * We saw 12 new problems + * We failed to check 0 packages Issues with CRAN packages are summarised below. ### New problems (This reports the first line of each new failure) -* causaleffect +* backbone + checking tests ... ERROR + +* deepdep + checking tests ... ERROR + +* egor + checking tests ... ERROR + +* GREMLINS checking examples ... ERROR + checking re-building of vignette outputs ... WARNING + +* incidentally + checking re-building of vignette outputs ... WARNING -* R6causal +* mstknnclust checking re-building of vignette outputs ... WARNING +* nat + checking tests ... ERROR + +* netmeta + checking examples ... ERROR + +* NetOrigin + checking examples ... ERROR + +* poppr + checking tests ... ERROR + * sfnetworks checking tests ... ERROR -### Failed to check +* signnet + checking examples ... ERROR -* DRviaSPCN (NA) -* genekitr (NA) -* immcp (NA) -* numbat (NA) -* Platypus (NA) -* tidySEM (NA) -* vivid (NA) diff --git a/revdep/failures.md b/revdep/failures.md index a4da12d38e4..9a207363396 100644 --- a/revdep/failures.md +++ b/revdep/failures.md @@ -1,566 +1 @@ -# DRviaSPCN - -
- -* Version: 0.1.2 -* GitHub: NA -* Source code: https://github.com/cran/DRviaSPCN -* Date/Publication: 2022-03-03 16:00:02 UTC -* Number of recursive dependencies: 169 - -Run `revdepcheck::cloud_details(, "DRviaSPCN")` for more info - -
- -## Error before installation - -### Devel - -``` -* using log directory ‘/tmp/workdir/DRviaSPCN/new/DRviaSPCN.Rcheck’ -* using R version 4.1.1 (2021-08-10) -* using platform: x86_64-pc-linux-gnu (64-bit) -* using session charset: UTF-8 -* using option ‘--no-manual’ -* checking for file ‘DRviaSPCN/DESCRIPTION’ ... OK -* checking extension type ... Package -* this is package ‘DRviaSPCN’ version ‘0.1.2’ -* package encoding: UTF-8 -* checking package namespace information ... OK -* checking package dependencies ... ERROR -Package required but not available: ‘clusterProfiler’ - -See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ -manual. -* DONE -Status: 1 ERROR - - - - - -``` -### CRAN - -``` -* using log directory ‘/tmp/workdir/DRviaSPCN/old/DRviaSPCN.Rcheck’ -* using R version 4.1.1 (2021-08-10) -* using platform: x86_64-pc-linux-gnu (64-bit) -* using session charset: UTF-8 -* using option ‘--no-manual’ -* checking for file ‘DRviaSPCN/DESCRIPTION’ ... OK -* checking extension type ... Package -* this is package ‘DRviaSPCN’ version ‘0.1.2’ -* package encoding: UTF-8 -* checking package namespace information ... OK -* checking package dependencies ... ERROR -Package required but not available: ‘clusterProfiler’ - -See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ -manual. -* DONE -Status: 1 ERROR - - - - - -``` -# genekitr - -
- -* Version: 1.0.8 -* GitHub: https://github.com/GangLiLab/genekitr -* Source code: https://github.com/cran/genekitr -* Date/Publication: 2022-11-23 11:30:02 UTC -* Number of recursive dependencies: 200 - -Run `revdepcheck::cloud_details(, "genekitr")` for more info - -
- -## Error before installation - -### Devel - -``` -* using log directory ‘/tmp/workdir/genekitr/new/genekitr.Rcheck’ -* using R version 4.1.1 (2021-08-10) -* using platform: x86_64-pc-linux-gnu (64-bit) -* using session charset: UTF-8 -* using option ‘--no-manual’ -* checking for file ‘genekitr/DESCRIPTION’ ... OK -* checking extension type ... Package -* this is package ‘genekitr’ version ‘1.0.8’ -* package encoding: UTF-8 -* checking package namespace information ... OK -* checking package dependencies ... ERROR -Package required but not available: ‘clusterProfiler’ - -See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ -manual. -* DONE -Status: 1 ERROR - - - - - -``` -### CRAN - -``` -* using log directory ‘/tmp/workdir/genekitr/old/genekitr.Rcheck’ -* using R version 4.1.1 (2021-08-10) -* using platform: x86_64-pc-linux-gnu (64-bit) -* using session charset: UTF-8 -* using option ‘--no-manual’ -* checking for file ‘genekitr/DESCRIPTION’ ... OK -* checking extension type ... Package -* this is package ‘genekitr’ version ‘1.0.8’ -* package encoding: UTF-8 -* checking package namespace information ... OK -* checking package dependencies ... ERROR -Package required but not available: ‘clusterProfiler’ - -See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ -manual. -* DONE -Status: 1 ERROR - - - - - -``` -# immcp - -
- -* Version: 1.0.3 -* GitHub: https://github.com/YuanlongHu/immcp -* Source code: https://github.com/cran/immcp -* Date/Publication: 2022-05-12 05:50:02 UTC -* Number of recursive dependencies: 194 - -Run `revdepcheck::cloud_details(, "immcp")` for more info - -
- -## Error before installation - -### Devel - -``` -* using log directory ‘/tmp/workdir/immcp/new/immcp.Rcheck’ -* using R version 4.1.1 (2021-08-10) -* using platform: x86_64-pc-linux-gnu (64-bit) -* using session charset: UTF-8 -* using option ‘--no-manual’ -* checking for file ‘immcp/DESCRIPTION’ ... OK -* this is package ‘immcp’ version ‘1.0.3’ -* package encoding: UTF-8 -* checking package namespace information ... OK -* checking package dependencies ... ERROR -Package required but not available: ‘clusterProfiler’ - -See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ -manual. -* DONE -Status: 1 ERROR - - - - - -``` -### CRAN - -``` -* using log directory ‘/tmp/workdir/immcp/old/immcp.Rcheck’ -* using R version 4.1.1 (2021-08-10) -* using platform: x86_64-pc-linux-gnu (64-bit) -* using session charset: UTF-8 -* using option ‘--no-manual’ -* checking for file ‘immcp/DESCRIPTION’ ... OK -* this is package ‘immcp’ version ‘1.0.3’ -* package encoding: UTF-8 -* checking package namespace information ... OK -* checking package dependencies ... ERROR -Package required but not available: ‘clusterProfiler’ - -See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ -manual. -* DONE -Status: 1 ERROR - - - - - -``` -# numbat - -
- -* Version: 1.1.0 -* GitHub: https://github.com/kharchenkolab/numbat -* Source code: https://github.com/cran/numbat -* Date/Publication: 2022-11-29 18:30:02 UTC -* Number of recursive dependencies: 183 - -Run `revdepcheck::cloud_details(, "numbat")` for more info - -
- -## Error before installation - -### Devel - -``` -* using log directory ‘/tmp/workdir/numbat/new/numbat.Rcheck’ -* using R version 4.1.1 (2021-08-10) -* using platform: x86_64-pc-linux-gnu (64-bit) -* using session charset: UTF-8 -* using option ‘--no-manual’ -* checking for file ‘numbat/DESCRIPTION’ ... OK -* this is package ‘numbat’ version ‘1.1.0’ -* package encoding: UTF-8 -* checking package namespace information ... OK -* checking package dependencies ... ERROR -Packages required but not available: 'ggtree', 'scistreer' - -See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ -manual. -* DONE -Status: 1 ERROR - - - - - -``` -### CRAN - -``` -* using log directory ‘/tmp/workdir/numbat/old/numbat.Rcheck’ -* using R version 4.1.1 (2021-08-10) -* using platform: x86_64-pc-linux-gnu (64-bit) -* using session charset: UTF-8 -* using option ‘--no-manual’ -* checking for file ‘numbat/DESCRIPTION’ ... OK -* this is package ‘numbat’ version ‘1.1.0’ -* package encoding: UTF-8 -* checking package namespace information ... OK -* checking package dependencies ... ERROR -Packages required but not available: 'ggtree', 'scistreer' - -See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ -manual. -* DONE -Status: 1 ERROR - - - - - -``` -# Platypus - -
- -* Version: 3.4.1 -* GitHub: NA -* Source code: https://github.com/cran/Platypus -* Date/Publication: 2022-08-15 07:20:20 UTC -* Number of recursive dependencies: 356 - -Run `revdepcheck::cloud_details(, "Platypus")` for more info - -
- -## Error before installation - -### Devel - -``` -* using log directory ‘/tmp/workdir/Platypus/new/Platypus.Rcheck’ -* using R version 4.1.1 (2021-08-10) -* using platform: x86_64-pc-linux-gnu (64-bit) -* using session charset: UTF-8 -* using option ‘--no-manual’ -* checking for file ‘Platypus/DESCRIPTION’ ... OK -* checking extension type ... Package -* this is package ‘Platypus’ version ‘3.4.1’ -* package encoding: UTF-8 -* checking package namespace information ... OK -... -* checking package dependencies ... ERROR -Package required but not available: ‘ggtree’ - -Packages suggested but not available for checking: - 'Matrix.utils', 'monocle3', 'ProjecTILs', 'SeuratWrappers' - -See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ -manual. -* DONE -Status: 1 ERROR - - - - - -``` -### CRAN - -``` -* using log directory ‘/tmp/workdir/Platypus/old/Platypus.Rcheck’ -* using R version 4.1.1 (2021-08-10) -* using platform: x86_64-pc-linux-gnu (64-bit) -* using session charset: UTF-8 -* using option ‘--no-manual’ -* checking for file ‘Platypus/DESCRIPTION’ ... OK -* checking extension type ... Package -* this is package ‘Platypus’ version ‘3.4.1’ -* package encoding: UTF-8 -* checking package namespace information ... OK -... -* checking package dependencies ... ERROR -Package required but not available: ‘ggtree’ - -Packages suggested but not available for checking: - 'Matrix.utils', 'monocle3', 'ProjecTILs', 'SeuratWrappers' - -See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ -manual. -* DONE -Status: 1 ERROR - - - - - -``` -# NA - -
- -* Version: NA -* GitHub: NA -* Source code: https://github.com/cran/NA -* Number of recursive dependencies: 0 - -Run `revdepcheck::cloud_details(, "NA")` for more info - -
- -## Error before installation - -### Devel - -``` - - - - - - -``` -### CRAN - -``` - - - - - - -``` -# tidySEM - -
- -* Version: 0.2.3 -* GitHub: https://github.com/cjvanlissa/tidySEM -* Source code: https://github.com/cran/tidySEM -* Date/Publication: 2022-04-14 17:50:02 UTC -* Number of recursive dependencies: 170 - -Run `revdepcheck::cloud_details(, "tidySEM")` for more info - -
- -## Error before installation - -### Devel - -``` -* using log directory ‘/tmp/workdir/tidySEM/new/tidySEM.Rcheck’ -* using R version 4.1.1 (2021-08-10) -* using platform: x86_64-pc-linux-gnu (64-bit) -* using session charset: UTF-8 -* using option ‘--no-manual’ -* checking for file ‘tidySEM/DESCRIPTION’ ... OK -* checking extension type ... Package -* this is package ‘tidySEM’ version ‘0.2.3’ -* package encoding: UTF-8 -* checking package namespace information ... OK -... -* checking for unstated dependencies in vignettes ... OK -* checking package vignettes in ‘inst/doc’ ... OK -* checking running R code from vignettes ... NONE - ‘Generating_syntax.Rmd’ using ‘UTF-8’... OK - ‘Plotting_graphs.Rmd’ using ‘UTF-8’... OK - ‘Tabulating_results.Rmd’ using ‘UTF-8’... OK - ‘sem_graph.Rmd’ using ‘UTF-8’... OK -* checking re-building of vignette outputs ... OK -* DONE -Status: 1 NOTE - - - - - -``` -### CRAN - -``` -* using log directory ‘/tmp/workdir/tidySEM/old/tidySEM.Rcheck’ -* using R version 4.1.1 (2021-08-10) -* using platform: x86_64-pc-linux-gnu (64-bit) -* using session charset: UTF-8 -* using option ‘--no-manual’ -* checking for file ‘tidySEM/DESCRIPTION’ ... OK -* checking extension type ... Package -* this is package ‘tidySEM’ version ‘0.2.3’ -* package encoding: UTF-8 -* checking package namespace information ... OK -... -* checking for unstated dependencies in vignettes ... OK -* checking package vignettes in ‘inst/doc’ ... OK -* checking running R code from vignettes ... NONE - ‘Generating_syntax.Rmd’ using ‘UTF-8’... OK - ‘Plotting_graphs.Rmd’ using ‘UTF-8’... OK - ‘Tabulating_results.Rmd’ using ‘UTF-8’... OK - ‘sem_graph.Rmd’ using ‘UTF-8’... OK -* checking re-building of vignette outputs ... OK -* DONE -Status: 1 NOTE - - - - - -``` -# vivid - -
- -* Version: 0.2.3 -* GitHub: NA -* Source code: https://github.com/cran/vivid -* Date/Publication: 2021-11-20 01:30:02 UTC -* Number of recursive dependencies: 206 - -Run `revdepcheck::cloud_details(, "vivid")` for more info - -
- -## Error before installation - -### Devel - -``` -* using log directory ‘/tmp/workdir/vivid/new/vivid.Rcheck’ -* using R version 4.1.1 (2021-08-10) -* using platform: x86_64-pc-linux-gnu (64-bit) -* using session charset: UTF-8 -* using option ‘--no-manual’ -* checking for file ‘vivid/DESCRIPTION’ ... OK -* this is package ‘vivid’ version ‘0.2.3’ -* package encoding: UTF-8 -* checking package namespace information ... OK -* checking package dependencies ... NOTE -... -* checking tests ... OK - Running ‘testthat.R’ -* checking for unstated dependencies in vignettes ... OK -* checking package vignettes in ‘inst/doc’ ... OK -* checking running R code from vignettes ... NONE - ‘vivid.Rmd’ using ‘UTF-8’... OK - ‘vividQStart.Rmd’ using ‘UTF-8’... OK -* checking re-building of vignette outputs ... OK -* DONE -Status: 2 NOTEs - - - - - -``` -### CRAN - -``` -* using log directory ‘/tmp/workdir/vivid/old/vivid.Rcheck’ -* using R version 4.1.1 (2021-08-10) -* using platform: x86_64-pc-linux-gnu (64-bit) -* using session charset: UTF-8 -* using option ‘--no-manual’ -* checking for file ‘vivid/DESCRIPTION’ ... OK -* this is package ‘vivid’ version ‘0.2.3’ -* package encoding: UTF-8 -* checking package namespace information ... OK -* checking package dependencies ... NOTE -... -* checking tests ... OK - Running ‘testthat.R’ -* checking for unstated dependencies in vignettes ... OK -* checking package vignettes in ‘inst/doc’ ... OK -* checking running R code from vignettes ... NONE - ‘vivid.Rmd’ using ‘UTF-8’... OK - ‘vividQStart.Rmd’ using ‘UTF-8’... OK -* checking re-building of vignette outputs ... OK -* DONE -Status: 2 NOTEs - - - - - -``` -# NA - -
- -* Version: NA -* GitHub: NA -* Source code: https://github.com/cran/NA -* Number of recursive dependencies: 0 - -Run `revdepcheck::cloud_details(, "NA")` for more info - -
- -## Error before installation - -### Devel - -``` - - - - - - -``` -### CRAN - -``` - - - - - - -``` +*Wow, no problems at all. :)* \ No newline at end of file diff --git a/revdep/problems.md b/revdep/problems.md index 0ccd26295d0..158821a8ccd 100644 --- a/revdep/problems.md +++ b/revdep/problems.md @@ -1,14 +1,129 @@ -# causaleffect +# backbone
-* Version: 1.3.15 -* GitHub: https://github.com/santikka/causaleffect -* Source code: https://github.com/cran/causaleffect -* Date/Publication: 2022-07-14 09:10:05 UTC -* Number of recursive dependencies: 13 +* Version: 2.1.1 +* GitHub: https://github.com/zpneal/backbone +* Source code: https://github.com/cran/backbone +* Date/Publication: 2022-10-18 17:35:06 UTC +* Number of recursive dependencies: 36 -Run `revdepcheck::cloud_details(, "causaleffect")` for more info +Run `revdepcheck::cloud_details(, "backbone")` for more info + +
+ +## Newly broken + +* checking tests ... ERROR + ``` + Running ‘tinytest.R’ + Running the tests in ‘tests/tinytest.R’ failed. + Last 13 lines of output: + test_backbone.R............... 29 tests OK + test_backbone.R............... 30 tests OK + test_backbone.R............... 30 tests OK + test_backbone.R............... 30 tests OK + test_backbone.R............... 30 tests OK + test_backbone.R............... 31 tests OK + test_backbone.R............... 32 tests OK + test_backbone.R............... 33 tests OK + test_backbone.R............... 34 tests OK + test_backbone.R............... 35 tests OK + test_backbone.R............... 36 tests OK + test_backbone.R............... 36 tests OK Error in i_set_vertex_attr(x, attr(value, "name"), index = value, value = attr(value, : + Length of new attribute value must be 1 or 110, the number of target vertices, not 10 + Calls: ... FUN -> eval -> eval -> -> i_set_vertex_attr + Execution halted + ``` + +# deepdep + +
+ +* Version: 0.4.1 +* GitHub: https://github.com/DominikRafacz/deepdep +* Source code: https://github.com/cran/deepdep +* Date/Publication: 2021-12-20 16:20:02 UTC +* Number of recursive dependencies: 144 + +Run `revdepcheck::cloud_details(, "deepdep")` for more info + +
+ +## Newly broken + +* checking tests ... ERROR + ``` + Running ‘spelling.R’ + Running ‘testthat.R’ + Running the tests in ‘tests/testthat.R’ failed. + Last 13 lines of output: + 6. └─ggraph:::create_layout.default(graph, layout, ...) + 7. ├─ggraph::create_layout(graph, layout, ...) + 8. └─ggraph:::create_layout.tbl_graph(graph, layout, ...) + 9. ├─dplyr::mutate(ungroup(activate(graph, "nodes")), .ggraph.orig_index = seq_len(graph_order())) + 10. └─tidygraph:::mutate.tbl_graph(...) + 11. └─tidygraph::mutate_as_tbl(.data, !!!dot) + 12. ├─tidygraph:::set_graph_data(.data, d_tmp) + 13. └─tidygraph:::set_graph_data.tbl_graph(.data, d_tmp) + 14. └─tidygraph:::set_node_attributes(x, value) + 15. └─igraph::`vertex_attr<-`(`*tmp*`, value = as.list(value)) + 16. └─igraph::`vertex.attributes<-`(graph, index = index, value = value) + + [ FAIL 9 | WARN 0 | SKIP 2 | PASS 25 ] + Error: Test failures + Execution halted + ``` + +# egor + +
+ +* Version: 1.22.12 +* GitHub: https://github.com/tilltnet/egor +* Source code: https://github.com/cran/egor +* Date/Publication: 2022-12-20 06:20:02 UTC +* Number of recursive dependencies: 89 + +Run `revdepcheck::cloud_details(, "egor")` for more info + +
+ +## Newly broken + +* checking tests ... ERROR + ``` + Running ‘testthat.R’ + Running the tests in ‘tests/testthat.R’ failed. + Last 13 lines of output: + Sorting data by egoID: Transforming alters data to long format: Transforming wide dyad data to edgelist: Sorting data by egoID: Transforming alters data to long format: Transforming wide dyad data to edgelist: Filtering out empty alter entries using provided network size values: Sorting data by egoID: Transforming alters data to long format: Transforming wide dyad data to edgelist: [ FAIL 1 | WARN 7 | SKIP 15 | PASS 205 ] + + ══ Skipped tests ═══════════════════════════════════════════════════════════════ + • On CRAN (15) + + ══ Failed tests ════════════════════════════════════════════════════════════════ + ── Failure ('test-clustered_graphs.R:55'): Methods work (properly) with grouping variable being completly NA. ── + igraph::V(clustered_graphs(mpf, "country")[[1]])$grp.size is not NULL + + `actual` is a double vector () + `expected` is NULL + + [ FAIL 1 | WARN 7 | SKIP 15 | PASS 205 ] + Error: Test failures + Execution halted + ``` + +# GREMLINS + +
+ +* Version: 0.2.0 +* GitHub: https://github.com/demiperimetre/GREMLINS +* Source code: https://github.com/cran/GREMLINS +* Date/Publication: 2020-11-25 13:50:04 UTC +* Number of recursive dependencies: 62 + +Run `revdepcheck::cloud_details(, "GREMLINS")` for more info
@@ -16,89 +131,343 @@ Run `revdepcheck::cloud_details(, "causaleffect")` for more info * checking examples ... ERROR ``` - Running examples in ‘causaleffect-Ex.R’ failed + Running examples in ‘GREMLINS-Ex.R’ failed The error most likely occurred in: - > ### Name: causal.effect - > ### Title: Identify a causal effect - > ### Aliases: causal.effect + > ### Name: plotMBM + > ### Title: Plot the mesoscopic view of the estimated MBM + > ### Aliases: plotMBM > > ### ** Examples > - > library(igraph) + > namesFG <- c('A','B') ... - > g <- graph.formula(x -+ y, z -+ x, z -+ y , x -+ z, z -+ x, simplify = FALSE) - > - > # Here the bidirected edge between X and Z is set to be unobserved in graph g - > # This is denoted by giving them a description attribute with the value "U" - > # The edges in question are the fourth and the fifth edge - > g <- set.edge.attribute(graph = g, name = "description", index = c(4,5), value = "U") - > causal.effect("y", "x", G = g) - Error in 0:(ind[i] - 1) : argument of length 0 - Calls: causal.effect -> id + [1] "gaussian" "bernoulli" + [1] "-------------------------------------------------------------------" + [1] " ------ Searching the numbers of blocks starting from [ 2 2 ] blocks" + [1] "ICL : -2028.78 . Nb of blocks: [ 2 2 ]" + [1] "Best model------ ICL : -2028.78 . Nb of clusters: [ 2 2 ] for [ A , B ] respectively" + > plotMBM(res_MBMsimu) + Error in i_set_edge_attr(graph = graph, name = name, value = value, check = FALSE) : + Length of new attribute value must be 1 or 0, the number of target edges, not 8 + Calls: plotMBM -> %>% -> set_edge_attr -> i_set_edge_attr + Execution halted + ``` + +* checking re-building of vignette outputs ... WARNING + ``` + Error(s) in re-building vignettes: + ... + --- re-building ‘EcologicalNetwork.Rmd’ using rmarkdown + Quitting from lines 130-131 (EcologicalNetwork.Rmd) + Error: processing vignette 'EcologicalNetwork.Rmd' failed with diagnostics: + Length of new attribute value must be 1 or 0, the number of target edges, not 14 + --- failed re-building ‘EcologicalNetwork.Rmd’ + + --- re-building ‘Introduction.Rmd’ using rmarkdown + --- finished re-building ‘Introduction.Rmd’ + + --- re-building ‘SimulatedNetwork.Rmd’ using rmarkdown + --- finished re-building ‘SimulatedNetwork.Rmd’ + + SUMMARY: processing the following file failed: + ‘EcologicalNetwork.Rmd’ + + Error: Vignette re-building failed. Execution halted ``` ## In both +* checking dependencies in R code ... NOTE + ``` + Namespace in Imports field not imported from: ‘mclust’ + All declared Imports should be used. + ``` + +# incidentally + +
+ +* Version: 1.0.1 +* GitHub: https://github.com/zpneal/incidentally +* Source code: https://github.com/cran/incidentally +* Date/Publication: 2022-08-05 22:40:09 UTC +* Number of recursive dependencies: 37 + +Run `revdepcheck::cloud_details(, "incidentally")` for more info + +
+ +## Newly broken + * checking re-building of vignette outputs ... WARNING ``` Error(s) in re-building vignettes: - --- re-building ‘causaleffect.ltx’ using tex - Error: processing vignette 'causaleffect.ltx' failed with diagnostics: - Running 'texi2dvi' on 'causaleffect.ltx' failed. - LaTeX errors: - ! LaTeX Error: File `ae.sty' not found. - - Type X to quit or to proceed, - or enter new name. (Default extension: sty) + ... + --- re-building ‘congress.Rmd’ using rmarkdown + trying URL 'https://www.govinfo.gov/bulkdata/BILLSTATUS/115/sres/BILLSTATUS-115-sres.zip' + Content type 'application/zip' length 2070239 bytes (2.0 MB) + ================================================== + downloaded 2.0 MB + trying URL 'https://www.govinfo.gov/bulkdata/BILLSTATUS/115/sres/BILLSTATUS-115-sres.zip' + Content type 'application/zip' length 2070239 bytes (2.0 MB) ... - l.16 \usepackage - {csquotes}^^M - ! ==> Fatal error occurred, no output PDF file produced! - --- failed re-building ‘simplification.ltx’ + --- failed re-building ‘congress.Rmd’ - SUMMARY: processing the following files failed: - ‘causaleffect.ltx’ ‘simplification.ltx’ + --- re-building ‘incidentally.Rmd’ using rmarkdown + --- finished re-building ‘incidentally.Rmd’ + + SUMMARY: processing the following file failed: + ‘congress.Rmd’ Error: Vignette re-building failed. Execution halted ``` -# R6causal +# mstknnclust
-* Version: 0.7.0 +* Version: 0.3.1 * GitHub: NA -* Source code: https://github.com/cran/R6causal -* Date/Publication: 2022-11-04 08:00:02 UTC -* Number of recursive dependencies: 100 +* Source code: https://github.com/cran/mstknnclust +* Date/Publication: 2020-09-17 12:20:03 UTC +* Number of recursive dependencies: 34 + +Run `revdepcheck::cloud_details(, "mstknnclust")` for more info + +
+ +## Newly broken + +* checking re-building of vignette outputs ... WARNING + ``` + Error(s) in re-building vignettes: + ... + --- re-building ‘guide.Rmd’ using rmarkdown + Quitting from lines 103-110 (guide.Rmd) + Error: processing vignette 'guide.Rmd' failed with diagnostics: + Length of new attribute value must be 1 or 84, the number of target vertices, not 2 + --- failed re-building ‘guide.Rmd’ + + SUMMARY: processing the following file failed: + ‘guide.Rmd’ + + Error: Vignette re-building failed. + Execution halted + ``` + +# nat + +
+ +* Version: 1.8.19 +* GitHub: https://github.com/natverse/nat +* Source code: https://github.com/cran/nat +* Date/Publication: 2022-04-06 11:50:02 UTC +* Number of recursive dependencies: 87 + +Run `revdepcheck::cloud_details(, "nat")` for more info + +
+ +## Newly broken -Run `revdepcheck::cloud_details(, "R6causal")` for more info +* checking tests ... ERROR + ``` + Running ‘test-all.R’ + Running the tests in ‘tests/test-all.R’ failed. + Last 13 lines of output: + ▆ + 1. ├─testthat::expect_warning(...) at test-ngraph.R:147:2 + 2. │ └─testthat:::quasi_capture(...) + 3. │ ├─testthat (local) .capture(...) + 4. │ │ └─base::withCallingHandlers(...) + 5. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo)) + 6. ├─nat::as.ngraph(testd, graph.attributes = gatts, vertex.attributes = list(X = testd$X[-1])) + 7. └─nat:::as.ngraph.data.frame(testd, graph.attributes = gatts, vertex.attributes = list(X = testd$X[-1])) + 8. └─nat::ngraph(...) + 9. └─igraph::set.vertex.attribute(g, name = n, value = vertex.attributes[[n]]) + 10. └─igraph:::i_set_vertex_attr(...) + + [ FAIL 1 | WARN 420 | SKIP 5 | PASS 787 ] + Error: Test failures + Execution halted + ``` + +## In both + +* checking examples ... WARNING + ``` + Found the following significant warnings: + + Warning: 'rgl.close' is deprecated. + Deprecated functions may be defunct as soon as of the next release of + R. + See ?Deprecated. + ``` + +# netmeta + +
+ +* Version: 2.7-0 +* GitHub: https://github.com/guido-s/netmeta +* Source code: https://github.com/cran/netmeta +* Date/Publication: 2022-12-22 09:30:02 UTC +* Number of recursive dependencies: 90 + +Run `revdepcheck::cloud_details(, "netmeta")` for more info + +
+ +## Newly broken + +* checking examples ... ERROR + ``` + Running examples in ‘netmeta-Ex.R’ failed + The error most likely occurred in: + + > ### Name: netcontrib + > ### Title: Contribution matrix in network meta-analysis + > ### Aliases: netcontrib print.netcontrib + > ### Keywords: contribution + > + > ### ** Examples + > + ... + > # Use the Woods dataset + > # + > data("Woods2010") + > p1 <- pairwise(treatment, event = r, n = N, + + studlab = author, data = Woods2010, sm = "OR") + > + > net1 <- netmeta(p1) + > cm <- netcontrib(net1) + Error: C stack usage 9968708 is too close to the limit + Execution halted + ``` + +## In both + +* checking data for non-ASCII characters ... NOTE + ``` + Note: found 2 marked UTF-8 strings + ``` + +# NetOrigin + +
+ +* Version: 1.1-4 +* GitHub: https://github.com/jmanitz/NetOrigin +* Source code: https://github.com/cran/NetOrigin +* Date/Publication: 2022-01-20 08:32:42 UTC +* Number of recursive dependencies: 77 + +Run `revdepcheck::cloud_details(, "NetOrigin")` for more info + +
+ +## Newly broken + +* checking examples ... ERROR + ``` + Running examples in ‘NetOrigin-Ex.R’ failed + The error most likely occurred in: + + > ### Name: origin + > ### Title: Origin Estimation for Propagation Processes on Complex Networks + > ### Aliases: origin origin_edm origin_backtracking origin_centrality + > ### origin_bayesian + > + > ### ** Examples + > + ... + > performance(om, start=1, graph=ptnGoe) + start est hitt rank spj dist + 1 X.Adolf.Hoyer.Strasse X.Gotthelf.Leimbach.Strasse FALSE 2 2 1332 + > + > # backtracking origin estimation (Manitz et al., 2016) + > ob <- origin(events=delayGoe[10,-c(1:2)], type='backtracking', graph=ptnGoe) + Error in if (V(graph)[current_node]$events > 0 | !start_with_event_node) { : + argument is of length zero + Calls: origin -> origin_backtracking + Execution halted + ``` + +# poppr + +
+ +* Version: 2.9.3 +* GitHub: https://github.com/grunwaldlab/poppr +* Source code: https://github.com/cran/poppr +* Date/Publication: 2021-09-07 07:00:02 UTC +* Number of recursive dependencies: 97 + +Run `revdepcheck::cloud_details(, "poppr")` for more info
## Newly broken +* checking tests ... ERROR + ``` + Running ‘test-all.R’ + Running the tests in ‘tests/test-all.R’ failed. + Last 13 lines of output: + Attributes: < Modes: list, NULL > + Attributes: < Lengths: 2, 0 > + Attributes: < names for target but not for current > + Attributes: < current is not list-like > + target is table, current is numeric + Backtrace: + ▆ + 1. └─poppr (local) expect_vertex_size_scale(pmsn, as.integer(table(mll(pc)))) at test-msn.R:439:2 + 2. ├─base::eval(...) at test-msn.R:105:2 + 3. │ └─base::eval(...) + 4. └─testthat::expect_equal(...) + + [ FAIL 2 | WARN 0 | SKIP 181 | PASS 378 ] + Error: Test failures + Execution halted + ``` + +## In both + * checking re-building of vignette outputs ... WARNING ``` Error(s) in re-building vignettes: ... - --- re-building ‘using_R6causal.Rmd’ using rmarkdown - Quitting from lines 196-198 (using_R6causal.Rmd) - Error: processing vignette 'using_R6causal.Rmd' failed with diagnostics: - Not identifiable. - --- failed re-building ‘using_R6causal.Rmd’ + --- re-building ‘algo.Rnw’ using knitr + Error: processing vignette 'algo.Rnw' failed with diagnostics: + Running 'texi2dvi' on 'algo.tex' failed. + LaTeX errors: + ! LaTeX Error: File `colortbl.sty' not found. + + Type X to quit or to proceed, + or enter new name. (Default extension: sty) + ... + l.270 \long + \def\@secondoffive#1#2#3#4#5{#2}^^M + ! ==> Fatal error occurred, no output PDF file produced! + --- failed re-building ‘algo.Rnw’ SUMMARY: processing the following file failed: - ‘using_R6causal.Rmd’ + ‘algo.Rnw’ Error: Vignette re-building failed. Execution halted ``` +* checking package dependencies ... NOTE + ``` + Package suggested but not available for checking: ‘RClone’ + ``` + # sfnetworks
@@ -120,20 +489,70 @@ Run `revdepcheck::cloud_details(, "sfnetworks")` for more info Running ‘testthat.R’ Running the tests in ‘tests/testthat.R’ failed. Last 13 lines of output: - 2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise) - 3. │ ├─testthat (local) .capture(...) - 4. │ │ ├─withr::with_output_sink(...) - 5. │ │ │ └─base::force(code) - 6. │ │ ├─base::withCallingHandlers(...) - 7. │ │ └─base::withVisible(code) - 8. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo)) - 9. ├─sfnetworks::st_network_cost(...) - 10. └─sfnetworks:::st_network_cost.sfnetwork(...) - 11. ├─base::do.call(igraph::distances, c(args, dots)) - 12. └─igraph (local) ``(``, 1, 10, weights = `<[m]>`, mode = "in", algorithm = "johnson") + > library(sfnetworks) + > + > test_check("sfnetworks") + [ FAIL 1 | WARN 1 | SKIP 0 | PASS 277 ] + + ══ Failed tests ════════════════════════════════════════════════════════════════ + ── Failure ('test_paths.R:242'): ... is passed correcly onto igraph::distances ── + isTRUE(all.equal(cost_dijkstra, cost_johnson)) is not FALSE - [ FAIL 1 | WARN 1 | SKIP 0 | PASS 276 ] + `actual`: TRUE + `expected`: FALSE + + [ FAIL 1 | WARN 1 | SKIP 0 | PASS 277 ] Error: Test failures Execution halted ``` +# signnet + +
+ +* Version: 1.0.0 +* GitHub: https://github.com/schochastics/signnet +* Source code: https://github.com/cran/signnet +* Date/Publication: 2022-12-22 15:10:02 UTC +* Number of recursive dependencies: 101 + +Run `revdepcheck::cloud_details(, "signnet")` for more info + +
+ +## Newly broken + +* checking examples ... ERROR + ``` + Running examples in ‘signnet-Ex.R’ failed + The error most likely occurred in: + + > ### Name: triad_census_signed + > ### Title: signed triad census + > ### Aliases: triad_census_signed + > + > ### ** Examples + > + > library(igraph) + ... + The following object is masked from ‘package:base’: + + union + + > g <- graph.full(4, directed = TRUE) + > E(g)$sign <- c(-1, 1, 1, -1, -1, 1) + Error in i_set_edge_attr(x, attr(value, "name"), index = value, value = attr(value, : + Length of new attribute value must be 1 or 12, the number of target edges, not 6 + Calls: E<- -> i_set_edge_attr + Execution halted + ``` + +## In both + +* checking installed package size ... NOTE + ``` + installed size is 7.8Mb + sub-directories of 1Mb or more: + libs 6.1Mb + ``` + diff --git a/tests/testthat/test-attributes.R b/tests/testthat/test-attributes.R index e8120864373..761a1a6ab74 100644 --- a/tests/testthat/test-attributes.R +++ b/tests/testthat/test-attributes.R @@ -211,3 +211,46 @@ test_that("attribute combinations handle errors correctly", { expect_error(as.undirected(g, edge.attr.comb = list(weight = "sum")), "invalid 'type'") expect_error(as.undirected(g, edge.attr.comb = list(weight = sum)), "invalid 'type'") }) + +test_that("can change type of attributes (#466)", { + g <- make_ring(10) + + V(g)$foo <- 1 + expect_equal(V(g)$foo, rep(1, 10)) + V(g)$foo <- "a" + expect_equal(V(g)$foo, rep("a", 10)) + V(g)$foo <- 2 + expect_equal(V(g)$foo, rep(2, 10)) + + E(g)$foo <- 1 + expect_equal(E(g)$foo, rep(1, 10)) + E(g)$foo <- "a" + expect_equal(E(g)$foo, rep("a", 10)) + E(g)$foo <- 2 + expect_equal(E(g)$foo, rep(2, 10)) +}) + +test_that("setting attributes strips names (#466)", { + g <- make_ring(10) + + V(g)$foo <- stats::setNames(1:10, letters[1:10]) + expect_identical(V(g)$foo, 1:10) + + E(g)$foo <- stats::setNames(1:10, letters[1:10]) + expect_identical(E(g)$foo, 1:10) + + V(g)$bar <- c(a = 1) + expect_identical(V(g)$bar, rep(1, 10)) + + E(g)$bar <- c(a = 1) + expect_identical(E(g)$bar, rep(1, 10)) +}) + +test_that("setting NULL attributes works and doesn't change the input (#466)", { + g <- make_ring(10) + + expect_identical(set_vertex_attr(g, "foo", value = NULL), g) + expect_identical(set_vertex_attr(g, "foo", 1:3, value = NULL), g) + expect_identical(set_edge_attr(g, "foo", value = NULL), g) + expect_identical(set_edge_attr(g, "foo", 1:3, value = NULL), g) +}) diff --git a/tests/testthat/test-graph.data.frame.R b/tests/testthat/test-graph.data.frame.R index 1f8d81f3593..60a1c538035 100644 --- a/tests/testthat/test-graph.data.frame.R +++ b/tests/testthat/test-graph.data.frame.R @@ -31,6 +31,13 @@ test_that("graph_from_data_frame works", { expect_that(df$edges, equals(relations)) }) +test_that("graph_from_data_frame() creates attributes for zero-row data frames (#466)", { + x <- data.frame(from = integer(), to = integer(), foo = integer(), bar = numeric()) + g <- graph_from_data_frame(x) + expect_identical(E(g)$foo, integer()) + expect_identical(E(g)$bar, numeric()) +}) + test_that("graph_from_data_frame works on matrices", { el <- cbind(1:5, 5:1, weight = 1:5) g <- graph_from_data_frame(el) diff --git a/tests/testthat/test-iterators.R b/tests/testthat/test-iterators.R index c39cdbd2952..b3370848aad 100644 --- a/tests/testthat/test-iterators.R +++ b/tests/testthat/test-iterators.R @@ -93,9 +93,11 @@ test_that("V(g) returns complete iterator, completeness is lost with next subset }) test_that("E(g) returns complete iterator, completeness is lost with next subsetting", { - g <- make_star(4) + g <- make_full_graph(4) iter <- E(g) expect_true(is_complete_iterator(iter)) expect_false(is_complete_iterator(iter[1])) expect_false(is_complete_iterator(iter[1:3])) + expect_false(is_complete_iterator(E(g, P = 1:4))) + expect_false(is_complete_iterator(E(g, path = 1:4))) }) diff --git a/tests/testthat/test-pajek.R b/tests/testthat/test-pajek.R index 6a912e8e7a4..ad38f117915 100644 --- a/tests/testthat/test-pajek.R +++ b/tests/testthat/test-pajek.R @@ -1,6 +1,6 @@ test_that("writing Pajek files works", { g <- make_ring(9) - V(g)$color <- c("red", "green", "yellow") + V(g)$color <- rep(c("red", "green", "yellow"), 3) tc <- rawConnection(raw(0), "w") write_graph(g, format = "pajek", file = tc)