Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

mutate_as_tbl

Base implementation of mutate


Description

This implementation of mutate is slightly faster than mutate at the expense of the graph only being updated in the end. This means that graph algorithms will not take changes happening during the mutate call into account.

Usage

mutate_as_tbl(.data, ...)

Arguments

.data

A tbl_graph object

...

columns to mutate

Details

The order of speed increase are rather small and in the ~1 millisecond per mutateed column order, so for regular use this should not be a choice. The operations not supported by mutate_as_tbl are e.g.

gr %>%
  activate(nodes) %>%
  mutate(weights = runif(10), degree = centrality_degree(weights))

as weights will only be made available in the graph at the end of the mutate call.

Value

A tbl_graph object


tidygraph

A Tidy API for Graph Manipulation

v1.2.0
MIT + file LICENSE
Authors
Thomas Lin Pedersen [cre, aut] (<https://orcid.org/0000-0002-5147-4711>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.