Coerce a Network Object to a data.frame
as.data.frame.network.RdThe as.data.frame method coerces its input to a data.frame containing
x's edges or vertices.
Usage
# S3 method for class 'network'
as.data.frame(
x,
...,
unit = c("edges", "vertices"),
na.rm = TRUE,
attrs_to_ignore = "na",
name_vertices = TRUE,
sort_attrs = FALSE,
store_eid = FALSE
)Arguments
- x
an object of class
network- ...
additional arguments
- unit
whether a
data.frameof edge or vertex attributes should be returned.- na.rm
logical; ignore missing edges/vertices when constructing the data frame?
- attrs_to_ignore
character; a vector of attribute names to exclude from the returned
data.frame(Default:"na")- name_vertices
logical; for
unit="edges", should the.tailand the.headcolumns contain vertex names as opposed to vertex indices?- sort_attrs
logical; should the attribute columns in the returned data frame be sorted alphabetically?
- store_eid
logical; for
unit="edges", should the edge ID in the network's internal representation be stored in a column.eid?