Skip to content

as_adjacency_matrix() should use weights instead of attr parameter #906

@szhorvat

Description

@szhorvat

In as_adjacency_matrix(), the attr parameter should be replaced by weights, to bring this in function in line with others that deal with weighted graphs.

  • attr takes an edge attribute name uses the elements from it as weights.
  • weights takes a weight vector.

This change was already made in the C core for 0.10, so the R interface should mirror it if we want to keep things simple. Usign weights is also more flexible as it makes it possible for weights to come from elsewhere than an attribute, which is important for implementing certain kinds of functionality (see e.g. #905).

The change can be made gradually, with supporting both attr and weights for a while.

Metadata

Metadata

Assignees

Labels

argument consistencyissues related to argument naming/defaultsfeaturea feature request or enhancementlifecycleDeprecating old APIs

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions