-
-
Notifications
You must be signed in to change notification settings - Fork 206
Expand file tree
/
Copy pathas_long_data_frame.Rd
More file actions
50 lines (49 loc) · 1.58 KB
/
as_long_data_frame.Rd
File metadata and controls
50 lines (49 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/conversion.R
\name{as_long_data_frame}
\alias{as_long_data_frame}
\title{Convert a graph to a long data frame}
\usage{
as_long_data_frame(graph)
}
\arguments{
\item{graph}{Input graph}
}
\value{
A long data frame.
}
\description{
A long data frame contains all metadata about both the vertices
and edges of the graph. It contains one row for each edge, and
all metadata about that edge and its incident vertices are included
in that row. The names of the columns that contain the metadata
of the incident vertices are prefixed with \code{from_} and \code{to_}.
The first two columns are always named \code{from} and \code{to} and
they contain the numeric ids of the incident vertices. The rows are
listed in the order of numeric vertex ids.
}
\section{Related documentation in the C library}{
\href{https://igraph.org/c/html/0.10.17/igraph-Structural.html#igraph_get_edgelist}{\code{get_edgelist()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_vcount}{\code{vcount()}}
}
\examples{
g <- make_(
ring(10),
with_vertex_(name = letters[1:10], color = "red"),
with_edge_(weight = 1:10, color = "green")
)
as_long_data_frame(g)
}
\seealso{
Other conversion:
\code{\link{as.matrix.igraph}()},
\code{\link{as_adj_list}()},
\code{\link{as_adjacency_matrix}()},
\code{\link{as_biadjacency_matrix}()},
\code{\link{as_data_frame}()},
\code{\link{as_directed}()},
\code{\link{as_edgelist}()},
\code{\link{as_graphnel}()},
\code{\link{graph_from_adj_list}()},
\code{\link{graph_from_graphnel}()}
}
\concept{conversion}