New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing "color" inconsistency ("ggrepel") and error for nodes=2 #20
Conversation
Change "color" to "colour" to be consistent with "grepel" and ggplot2 and avoid a warning for "segment.color"
Change "color" to "colour" to be consistent with "ggrepel" and ggplot2 and avoid a warning for "segment.color"
In the default function parameter "x" doesn't exist yet, it is replaced with "model". When the number of nodes is two, the condition "(nrow(edges[, 1:2]) > nrow(unique(edges[, 1:2])))" cannot be assessed. This is fixed using "drop" argument in data.frame/matrix extractor.
Change "color" to "colour" to be consistent with "ggrepel" and ggplot2 and avoid a warning for "segment.color"
Change "color" to "colour" to be consistent with "ggrepel" and ggplot2 and avoid a warning for "segment.color"
Change "color" to "colour" to be consistent with "ggrepel" and ggplot2 and to avoid a warning for "segment.color"
Change "color" to "colour" to be consistent with "ggrepel" and ggplot2 and to avoid a warning for "segment.color"
Change "color" to "colour" to be consistent with "ggrepel" and ggplot2 and to avoid a warning for "segment.color"
Change "color" to "colour" to be consistent with "ggrepel" and ggplot2 and to avoid a warning for "segment.color"
Bad editing the first time.
R/fortify-network.R
Outdated
@@ -199,7 +199,6 @@ fortify.network <- function(model, data = NULL, | |||
# add missing columns to nodes data | |||
nodes$xend = nodes$x | |||
nodes$yend = nodes$y | |||
names(nodes) = names(edges)[1:ncol(nodes)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mcanouil This line is the only one that I did not get straight away in your PR. No idea why it's not needed any more, I'll just trust you on that :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I recall properly, it was something about the fact that nodes cannot have more columns than the number of edges (but it's been a while and a lot of the packages on which ggnetwork relies on have changed).
Since both ggplot2 and ggrepel use "colour", a warning occures when using "segment.color".
Fixing an issue in fortify.network for nodes=2, in which case, the matrix/data.frame structure was dropped. Issue solved by using "drop" argument.
Fixing issue in fortify.network when no edges.