diff --git a/DESCRIPTION b/DESCRIPTION index 86140ce2cc5..0f2ae57119e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -35,7 +35,7 @@ URL: https://r.igraph.org/, https://igraph.org/, BugReports: https://github.com/igraph/rigraph/issues Depends: methods, - R (>= 3.5.0) + R (>= 4.0.0) Imports: cli, graphics, diff --git a/R/iterators.R b/R/iterators.R index 95f20d938a9..2cd55abea5c 100644 --- a/R/iterators.R +++ b/R/iterators.R @@ -1550,7 +1550,7 @@ print_igraph_vs_legacy <- function( ## Double bracket va <- vertex_attr(graph) if (all(sapply(va, is.atomic))) { - print(as.data.frame(va, stringsAsFactors = FALSE)[ + print(list2DF(va)[ as.vector(x), , drop = FALSE @@ -1716,7 +1716,7 @@ print_igraph_vs_cli <- function( # atomic. If any attribute is list-valued, drop to a named list sliced to # the selected vertices instead of forcing it into a table. if (all(vapply(vertex_attrs, is.atomic, logical(1)))) { - print(as.data.frame(vertex_attrs, stringsAsFactors = FALSE)[ + print(list2DF(vertex_attrs)[ as.vector(x), , drop = FALSE diff --git a/R/print.R b/R/print.R index 1c2afaf9942..dd421cf0761 100644 --- a/R/print.R +++ b/R/print.R @@ -296,14 +296,13 @@ print_edge_detail <- function(graph, edges) { etail <- tail_of(graph, edges) ehead <- head_of(graph, edges) df <- data.frame( - stringsAsFactors = FALSE, tail = as_ids(etail), head = as_ids(ehead), tid = as.vector(etail), hid = as.vector(ehead) ) if (length(ea)) { - ea <- do_call(data.frame, .args = ea, stringsAsFactors = FALSE) + ea <- do_call(data.frame, .args = ea) df <- cbind(df, ea[as.vector(edges), , drop = FALSE]) } print(df) diff --git a/R/sparsedf.R b/R/sparsedf.R index dfd3f78707d..3d4ffd22d55 100644 --- a/R/sparsedf.R +++ b/R/sparsedf.R @@ -62,7 +62,7 @@ sdf <- function(..., row.names = NULL, NROW = NULL) { #' @method as.data.frame igraphSDF #' @export as.data.frame.igraphSDF <- function(x, row.names, optional, ...) { - as.data.frame(lapply(x, rep, length.out = attr(x, "NROW"))) + list2DF(lapply(x, rep, length.out = attr(x, "NROW"))) } #' @method "[" igraphSDF