Skip to content

Commit

Permalink
Changes for the 1.19.0 submission. This should not only resolve the
Browse files Browse the repository at this point in the history
issues spotted by the CRAN checks, but also extra memory issues flagged
by Ripley and Kalibera.  Most of these are in the category of "things that
should not go wrong if the package is used properly," but they have been
tightened up nevertheless.
  • Loading branch information
CarterButts committed Dec 7, 2024
1 parent 2201513 commit 977094e
Show file tree
Hide file tree
Showing 14 changed files with 76 additions and 1,957 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ v1.19.0
- Non-visible and documentation changes for CRAN compliance.
- Internal argument handling changes; should generally be invisible, but
may in some complex cases avoid problems when calling network().
- Added more internal checks to edge allocation and handling. These should
not be visible for normal use, but should catch/avoid errors due to
improper use (e.g., trying to make/use network objects with malformed
edges). This is not expected to break any working code, but if you
have been doing things you shouldn't have been doing (e.g., edges
without both inl and outl elements), then you might find that you need
to fix things. (This usually takes effort, so you are not likely to
have done it by accident.)
- Bolstered add.edge and add.edges against improper edge.check arguments.
- Made get.inducedSubgraph() and permute.vertexIDs() generic.
- Replaced now non-functional Pajek URLs with Internet Archive versions.
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: network
Version: 1.19.0
Date: 2024-12-04
Date: 2024-12-06
Title: Classes for Relational Data
Authors@R: c(
person("Carter T.", "Butts", role=c("aut","cre"), email="[email protected]"),
Expand Down
8 changes: 6 additions & 2 deletions R/access.R
Original file line number Diff line number Diff line change
Expand Up @@ -656,11 +656,11 @@ get.edge.attribute.network <- function(x, attrname, unlist=TRUE, na.omit=FALSE,
if (!is.list(x))
stop("x must be a network object or a list.")

if (!is.character(attrname))
if (!is.character(attrname) || (length(attrname)==0))
stop("attrname must be a character vector.")

if (!is.logical(unlist) || !is.logical(na.omit) || !is.logical(null.na) ||
!is.logical(deleted.edges.omit))
!is.logical(deleted.edges.omit) || (length(unlist)*length(na.omit)*length(null.na)*length(deleted.edges.omit)==0))
stop("na.omit, null.na, deleted.edges.omit must be a logical vector.")

edges <- .Call(getEdgeAttribute_R,x,attrname,na.omit,null.na,deleted.edges.omit)
Expand Down Expand Up @@ -1965,6 +1965,10 @@ set.edge.value.network <- function(x, attrname, value, e = seq_along(x$mel), ...
} else if (min(dim(value)) < n) {
stop("set.edge.value requires a matrix whose dimension is equal to or larger than the network size")
}
#Ensure that the attribute name is legit
attrname<-as.character(attrname)
if(length(attrname)==0)
stop("Attribute name required in set.edge.value.network.")
#Do the deed
xn<-substitute(x)
x<-.Call(setEdgeValue_R,x,attrname,value,e)
Expand Down
2 changes: 1 addition & 1 deletion R/as.edgelist.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ as.edgelist <- function(x, ...){
#' @aliases edgelist
#' @param x a \code{network} object with additional class added indicating how
#' it should be dispatched.
#' @param output return type: a \code{\link{matrix}} or a \code{\link{tibble}};
#' @param output return type: a \code{\link{matrix}} or a \code{\link[tibble]{tibble}};
#' see \code{\link{as.matrix.network}} for the difference.
#' @param attrname optionally, the name of an edge attribute to use for edge
#' values; may be a vector of names if \code{output="tibble"}
Expand Down
4 changes: 2 additions & 2 deletions R/coercion.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#' The \code{as.matrix} methods attempt to coerce their input to a matrix in
#' adjacency, incidence, or edgelist form. Edge values (from a stored
#' attribute) may be used if present. \code{\link[tibble:as_tibble]{as_tibble}}
#' coerces into an edgelist in \code{\link{tibble}} (a type of
#' coerces into an edgelist in \code{\link[tibble]{tibble}} (a type of
#' \code{\link{data.frame}}) form; this can be especially useful if extrecting
#' a character-type edge attribute.
#'
Expand Down Expand Up @@ -86,7 +86,7 @@
#' edglist form?
#' @param na.rm logical; should missing edges/vertices be included in the
#' edgelist formats? Ignored if \code{as.sna.edgelist=TRUE}.
#' @param unit whether a \code{\link{tibble}} of edge or vertex attributes
#' @param unit whether a \code{\link[tibble]{tibble}} of edge or vertex attributes
#' should be returned.
#' @param ... additional arguments.
#' @return For \code{as.matrix} methods, an adjacency, incidence, or edgelist
Expand Down
2 changes: 1 addition & 1 deletion man/as.edgelist.Rd

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

4 changes: 2 additions & 2 deletions man/as.matrix.network.Rd

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

7 changes: 0 additions & 7 deletions revdep/.gitignore

This file was deleted.

153 changes: 0 additions & 153 deletions revdep/README.md

This file was deleted.

18 changes: 0 additions & 18 deletions revdep/cran.md

This file was deleted.

5 changes: 0 additions & 5 deletions revdep/email.yml

This file was deleted.

26 changes: 0 additions & 26 deletions revdep/failures.md

This file was deleted.

Loading

0 comments on commit 977094e

Please sign in to comment.