Skip to content

Commit

Permalink
cran: remove links to adespatial
Browse files Browse the repository at this point in the history
  • Loading branch information
ahasverus committed Oct 11, 2023
1 parent 82fd1d3 commit 19cd57a
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 19 deletions.
11 changes: 6 additions & 5 deletions R/edges_weights_vector.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#' Create an edges weights vector
#'
#' @description
#' Creates an edges weights vector that can be used in [adespatial::aem()].
#' Resulting edges weights equal to 0 will be replaced by `4 x max(w)`,
#' where `max(w)` is the maximal weight in the matrix.
#' Creates an edges weights vector that can be used in `aem()` of the package
#' `adespatial`. Resulting edges weights equal to 0 will be replaced by
#' `4 x max(w)`, where `max(w)` is the maximal weight in the matrix.
#'
#' @param x a `list` of length 2. The nodes_by_edges matrix returned by
#' `nodes_by_edges_matrix()` or [adespatial::aem.build.binary()].
#' `nodes_by_edges_matrix()` (or `aem.build.binary()` of the package
#' `adespatial`).
#'
#' @param y a `data.frame` with the following three columns: `from`
#' (the first node of the edge), `to` (the second node of the edge), and
Expand Down Expand Up @@ -68,7 +69,7 @@ edges_weights_vector <- function(x, y) {

if (any(!(names(x) %in% c("se.mat", "edges")))) {
stop("Argument 'x' must be a nodes-by-edges matrix as returned by ",
"nodes_by_edges_matrix() or adespatial::aem.build.binary()",
"nodes_by_edges_matrix() or aem.build.binary() (adespatial)",
call. = FALSE)
}

Expand Down
9 changes: 5 additions & 4 deletions R/nodes_by_edges_matrix.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#' Create a nodes-by-edges matrix
#'
#' @description
#' Creates a nodes-by-edges matrix that will be used by [adespatial::aem()].
#' This function creates the same output as [adespatial::aem.build.binary()]
#' but works in a different way: it's only based on node labels (not on
#' coordinates). Also, this function adds labels to nodes and edges.
#' Creates a nodes-by-edges matrix that will be used by `aem()` of the package
#' `adespatial`. This function creates the same output as `aem.build.binary()`
#' of the package `adespatial` but works in a different way: it's only based on
#' node labels (not on coordinates). Also, this function adds labels to nodes
#' and edges.
#'
#' @param edges a `data.frame` with the following two columns: `from` (the
#' first node of the edge) and `to` (the second node of the edge).
Expand Down
2 changes: 1 addition & 1 deletion man/chessboard-package.Rd

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

9 changes: 5 additions & 4 deletions man/edges_weights_vector.Rd

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

9 changes: 5 additions & 4 deletions man/nodes_by_edges_matrix.Rd

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

2 changes: 1 addition & 1 deletion tests/testthat/test-edges_weights_vector.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ test_that("edges_weights_vector() - Tests for errors", {
expect_error(edges_weights_vector(nodes_edges_bad),
paste0("Argument 'x' must be a nodes-by-edges matrix as ",
"returned by nodes_by_edges_matrix() or ",
"adespatial::aem.build.binary()"),
"aem.build.binary() (adespatial)"),
fixed = TRUE)

expect_error(edges_weights_vector(nodes_edges),
Expand Down

0 comments on commit 19cd57a

Please sign in to comment.