You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
options(conflicts.policy=list(warn=FALSE))
library(igraph)
# create two graphsg1<- make_graph(~B--C, C--D)
g2<- make_graph(~A--G, E--F)
# add an edge attribute of class POSIXct to each graphg1<- set_vertex_attr(g1, "date", value= as.POSIXct(c("2021-01-01 01:01:01", "2022-02-02 02:02:02", "2023-03-03 03:03:03")))
g2<- set_vertex_attr(g2, "date", value= as.POSIXct(c("2021-03-03 03:03:03", "2022-04-04 04:04:04", "2023-05-05 05:05:05", "2024-06-06 06:06:06")))
# create the union of the two graphsu<- disjoint_union(g1, g2)
# now print the structure of g1, g2, and u
vertex_attr(u, "date")
#> [1] 1609459261 1643763722 1677808983 1614736983 1649037844 1683255905 1717646766
I'd suggest to rename this issue, as it actually is about vertex attributes, not edge attributes (edge attributes have been addressed already in #761 and #1587).
krlmlr
changed the title
disjoint_union() and edge attributesdisjoint_union() and vertex attributes
Dec 31, 2024
Needs same treatment as #761.
Created on 2024-12-20 with reprex v2.1.1
CC @bockthom @maxloeffler.
The text was updated successfully, but these errors were encountered: