Skip to content

Commit

Permalink
When network() propagates arguments to as.network(), use match.call()…
Browse files Browse the repository at this point in the history
… and eval.parent() rather than passing arguments through by name, thus preserving missing() information.
  • Loading branch information
krivit committed Jan 30, 2023
1 parent 5fb95d2 commit 7372a58
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions R/constructors.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@ network<-function(x, vertex.attr=NULL, vertex.attrnames=NULL,
multiple=FALSE, bipartite=FALSE, ...)
{
#Initialize the network object
g<-as.network(x,directed=directed,hyper=hyper,loops=loops,
multiple=multiple,bipartite=bipartite,...)
mc <- match.call()
mc$vertex.attr <- NULL
mc[[1]] <- as.name("as.network")
g <- eval.parent(mc)

#Add vertex attributes, if needed
if(!is.null(vertex.attr)){
#Create vertex attribute names, if needed
Expand Down

0 comments on commit 7372a58

Please sign in to comment.