I am trying to create a plot in igraph in which nodes are colored red for females and blue for males. I have a data frame called "advisory_edge_1" that houses my edge list. I have another data frame called "gender_attributes" which includes a list of nodes in the first column and a gender indicator in the second column (1=female, 2=male). When I set my vertex colors I get the error "Warning message:In length(vattrs[[name]]) <- vc : length of NULL cannot be changed".
I am unsure why I am getting this message. My code is below.
g2 <- graph_from_data_frame(d=advisory_edge_1, vertices = gender_attributes, directed = FALSE)
V(g2)$color <- ifelse(V(g2)$gender == 1, "red", "blue")
plot(g2, layout=layout.circle(g2))

