Skip to content

Commit 278ea9b

Browse files
Updated name for helper function to check colors for consistency.
1 parent a217154 commit 278ea9b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

R/map_autographr.R

+5-5
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@
5555
#' Group variables should have a minimum of 3 nodes,
5656
#' if less, number groups will be reduced by
5757
#' merging categories with lower counts into one called "other".
58-
#' @param edge_color Edge variable to be used for coloring the nodes.
58+
#' @param edge_color Tie variable to be used for coloring the nodes.
5959
#' It is easiest if this is added as an edge or tie attribute
6060
#' to the graph before plotting.
6161
#' Edges can also be colored by declaring a color instead.
62-
#' @param edge_size Edge variable to be used for sizing the edges.
62+
#' @param edge_size Tie variable to be used for sizing the edges.
6363
#' This can be any continuous variable on the nodes of the network.
6464
#' Since this function expects this to be an existing variable,
6565
#' it is recommended to calculate all edge-related statistics prior
@@ -938,7 +938,7 @@ map_dynamic <- function(edges_out, nodes_out, edge_color, node_shape,
938938
if (!is.null(edge_color)) {
939939
# Remove NAs in edge color, if declared
940940
if (edge_color %in% names(edges_out)) {
941-
edge_color <- check_color(edges_out[[edge_color]])
941+
edge_color <- .check_color(edges_out[[edge_color]])
942942
}
943943
} else edge_color <- "black"
944944
if (!is.null(edge_size)) {
@@ -962,7 +962,7 @@ map_dynamic <- function(edges_out, nodes_out, edge_color, node_shape,
962962
} else node_shape <- "circle"
963963
if (!is.null(node_color)) {
964964
if (node_color %in% names(nodes_out)) {
965-
node_color <- check_color(nodes_out[[node_color]])
965+
node_color <- .check_color(nodes_out[[node_color]])
966966
}
967967
} else if (is.null(node_color) & "Infected" %in% names(nodes_out)) {
968968
node_color <- as.factor(ifelse(nodes_out[["Exposed"]], "Exposed",
@@ -1003,7 +1003,7 @@ map_dynamic <- function(edges_out, nodes_out, edge_color, node_shape,
10031003
p
10041004
}
10051005

1006-
check_color <- function(v) {
1006+
.check_color <- function(v) {
10071007
color <- grDevices::colors()
10081008
color <- color[!color %in% "black"]
10091009
v <- ifelse(is.na(v), "black", v)

0 commit comments

Comments
 (0)