Skip to content

Commit

Permalink
added tests for duplicated indices
Browse files Browse the repository at this point in the history
  • Loading branch information
schochastics committed Jan 22, 2025
1 parent 56ba6e9 commit f4795c7
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions R/data_frame.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#' Create a graph from an edge list matrix
#'
#' @description
Expand Down Expand Up @@ -198,9 +197,9 @@ graph_from_data_frame <- function(d, directed = TRUE, vertices = NULL) {
if (ncol(vertices) > 1) {
for (i in 2:ncol(vertices)) {
newval <- vertices[, i]
if (inherits(newval, "factor")) {
newval <- as.character(newval)
}
# if (inherits(newval, "factor")) {
# newval <- as.character(newval)
# }
attrs[[names(vertices)[i]]] <- newval
}
}
Expand All @@ -219,9 +218,9 @@ graph_from_data_frame <- function(d, directed = TRUE, vertices = NULL) {
if (ncol(d) > 2) {
for (i in 3:ncol(d)) {
newval <- d[, i]
if (inherits(newval, "factor")) {
newval <- as.character(newval)
}
# if (inherits(newval, "factor")) {
# newval <- as.character(newval)
# }
attrs[[names(d)[i]]] <- newval
}
}
Expand Down

0 comments on commit f4795c7

Please sign in to comment.