1% Generated by roxygen2: do not edit by hand
2% Please edit documentation in R/rename_edge_attrs.R
3\name{rename_edge_attrs}
4\alias{rename_edge_attrs}
5\title{Rename an edge attribute}
6\usage{
7rename_edge_attrs(graph, edge_attr_from, edge_attr_to)
8}
9\arguments{
10\item{graph}{A graph object of class \code{dgr_graph}.}
11
12\item{edge_attr_from}{The name of the edge attribute that will be renamed.}
13
14\item{edge_attr_to}{The new name of the edge attribute column identified in
15\code{edge_attr_from}.}
16}
17\value{
18A graph object of class \code{dgr_graph}.
19}
20\description{
21Within a graph's internal edge data frame (edf), rename an existing edge
22attribute.
23}
24\examples{
25# Create a random graph using the
26# `add_gnm_graph()` function
27graph <-
28  create_graph() \%>\%
29  add_gnm_graph(
30    n = 5,
31    m = 8,
32    set_seed = 23) \%>\%
33  set_edge_attrs(
34    edge_attr = color,
35    values = "green")
36
37# Get the graph's internal edf
38# to show which edge attributes
39# are available
40graph \%>\% get_edge_df()
41
42# Rename the `color` node
43# attribute as `weight`
44graph <-
45  graph \%>\%
46  rename_edge_attrs(
47    edge_attr_from = color,
48    edge_attr_to = labelfontcolor)
49
50# Get the graph's internal
51# edf to show that the edge
52# attribute had been renamed
53graph \%>\% get_edge_df()
54
55}
56\seealso{
57Other Edge creation and removal:
58\code{\link{add_edge_clone}()},
59\code{\link{add_edge_df}()},
60\code{\link{add_edges_from_table}()},
61\code{\link{add_edges_w_string}()},
62\code{\link{add_edge}()},
63\code{\link{add_forward_edges_ws}()},
64\code{\link{add_reverse_edges_ws}()},
65\code{\link{copy_edge_attrs}()},
66\code{\link{create_edge_df}()},
67\code{\link{delete_edges_ws}()},
68\code{\link{delete_edge}()},
69\code{\link{delete_loop_edges_ws}()},
70\code{\link{drop_edge_attrs}()},
71\code{\link{edge_data}()},
72\code{\link{join_edge_attrs}()},
73\code{\link{mutate_edge_attrs_ws}()},
74\code{\link{mutate_edge_attrs}()},
75\code{\link{recode_edge_attrs}()},
76\code{\link{rescale_edge_attrs}()},
77\code{\link{rev_edge_dir_ws}()},
78\code{\link{rev_edge_dir}()},
79\code{\link{set_edge_attr_to_display}()},
80\code{\link{set_edge_attrs_ws}()},
81\code{\link{set_edge_attrs}()}
82}
83\concept{Edge creation and removal}
84