Skip to content

Do not recycle logical vectors when indexing into edge/vertex selectors #848

@szhorvat

Description

@szhorvat

With @krlmlr's agreement, the following behaviour is undesirable:

> g <- make_ring(5) # graph with 5 vertices
> V(g)[c(T,F)] # recycles, completing the vector to T,F,T,F,T
+ 3/5 vertices, from 4cd3034:
[1] 1 3 5

Reasoning:

Suppose that we have a graph g and a modified version g2. Then we try to select some vertices of g based on properties of g2, like so: V(g)[ V(g2)$foo > 2 ]. If g and g2 have a different number of vertices, this should ideally result in an error. Right now it does not, due to recycling.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions