briatte / ggnetwork

Geoms to plot networks with ggplot2
https://briatte.github.io/ggnetwork/
146 stars 28 forks source link

Extra dim/dimnames attributes in columns of fortify.network output #29

Open mgagliol opened 6 years ago

mgagliol commented 6 years ago

Hello,

at least in the CRAN version, the data.frame produced by fortify.network has "dim" and "dimnames" attributes set for columns x, y, xend, yend. This is an issue for dplyr::filter, which complains that the columns are not one-dimensional vectors. A simple turnaround that I use is to first call: as.data.frame(lapply(X=df, FUN=as.vector)) on the output (here named df).

Given the increasing popularity of dplyr and other tidyverse packages, I was wondering if there is a compelling reason to keep these extra attributes in the output?

Thanks a lot for an otherwise excellent package!