1% Generated by roxygen2: do not edit by hand
2% Please edit documentation in R/get_pagerank.R
3\name{get_pagerank}
4\alias{get_pagerank}
5\title{Get the PageRank values for all nodes}
6\usage{
7get_pagerank(graph, directed = TRUE, damping = 0.85)
8}
9\arguments{
10\item{graph}{A graph object of class \code{dgr_graph}.}
11
12\item{directed}{If \code{TRUE} (the default) then directed paths will be
13considered for directed graphs. This is ignored for undirected graphs.}
14
15\item{damping}{The damping factor. The default value is set to \code{0.85}.}
16}
17\value{
18A data frame with PageRank values for each of the nodes.
19}
20\description{
21Get the PageRank values for all nodes in the graph.
22}
23\examples{
24# Create a random graph using the
25# `add_gnm_graph()` function
26graph <-
27  create_graph() \%>\%
28  add_gnm_graph(
29    n = 10,
30    m = 15,
31    set_seed = 23)
32
33# Get the PageRank scores
34# for all nodes in the graph
35graph \%>\%
36  get_pagerank()
37
38# Colorize nodes according to their
39# PageRank scores
40graph <-
41  graph \%>\%
42  join_node_attrs(
43    df = get_pagerank(graph = .)) \%>\%
44  colorize_node_attrs(
45    node_attr_from = pagerank,
46    node_attr_to = fillcolor,
47    palette = "RdYlGn")
48
49}
50