Skip to content

vertices() should do more checking itself #1250

@maelle

Description

@maelle

Rather than current situation: + does this work. See paths() and edges() too.

Current list for vertices

  • vertices to check length of attributes vs number of names.
  • vertices to add names that are character. See case below
library("igraph")
#> 
#> Attaching package: 'igraph'
#> The following objects are masked from 'package:stats':
#> 
#>     decompose, spectrum
#> The following object is masked from 'package:base':
#> 
#>     union
gg <- graph.empty() + vertices(c(1,2,3,4)) + edges(c("1","2","3","4"))
gg + gg
#> Error in `+.igraph`(g, setdiff(uninames, V(g)$name)): Cannot add unknown type to igraph graph

Created on 2024-02-26 with reprex v2.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    upkeepmaintenance, infrastructure, and similarvertex namesissues related to vertex names (e.g. what to do when named and unnamed graph are combined)

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions