stocnet / manynet

Many Ways to Make, Manipulate, and Map Myriad Networks
https://stocnet.github.io/manynet/
Other
12 stars 0 forks source link

Make `graphr/s/t` functions accept arguments following US and British spelling #41

Closed henriquesposito closed 4 months ago

henriquesposito commented 11 months ago

graphr(ison_adolescents, node_color = "blue") should be equivalent to graphr(ison_adolescents, node_colour = "blue")

jhollway commented 5 months ago

Could the ... be used to handle this? That is, if a user writes node_colour = "green", then we can list and look in the dot parameter ... for known aliases such as colour, check that this is not a repetition (e.g. node_color = "blue", node_colour = "green"), and if not apply the value/vector instead to node_color internally and at the outset?

henriquesposito commented 5 months ago

This is a good idea, I will try this out. Thank you for the feedback.

henriquesposito commented 4 months ago

I have tried doing this using the extra arguments (...), but this caused issues with the extra layout arguments later... For now, I have implemented this using extra arguments (documented together). Although this is perhaps not an elegant solution, it works well ...

graphr(ison_adolescents, node_color = "green", edge_color = "blue")
graphr(ison_adolescents, node_colour = "green",edge_colour = "blue")
graphs(to_egos(ison_adolescents), waves = 8, node_colour = "green",edge_colour = "blue")
ison_adolescents %>%
  mutate_ties(year = sample(1995:1998, 10, replace = TRUE)) %>%
  to_waves(attribute = "year", cumulative = TRUE) %>%
  grapht(node_colour = "green",edge_colour = "blue")
jhollway commented 4 months ago

Should we maybe put those extra arguments later in the argument order so that one could, hypothetically, explicate them in order? E.g.:

graphr(ison_adolescents, "stress", TRUE, "green", "square", 12) # etc