Skip to contents

Thin convenience wrapper around [pagerank()] for the stable [screaming_frog_bundle()] handoff object. Only `bundle$edges` enter the graph. Raw observations and dedicated redirect, canonical, indexability, and resource rows stay out of the edge list and are mapped to the existing [pagerank()] arguments.

Usage

pagerank_screaming_frog(
  bundle,
  accepted_placements = NULL,
  link_origins = NULL,
  placement_weights = NULL,
  weight_col = NULL,
  apply_canonicals = TRUE,
  apply_redirects = TRUE,
  preset = NULL,
  ...
)

Arguments

bundle

A `screaming_frog_bundle` object.

accepted_placements, placement_weights

Placement controls forwarded to [pagerank()], which owns them: placement is a crawler-neutral concept, and this wrapper only supplies the bundle's normalized `placement` column as [pagerank()]'s `placement_col`. See [pagerank()] for the vocabulary (`"content"`, `"nav"`, `"header"`, `"footer"`, `"aside"`) and semantics.

Optional character vector of normalized link origins to retain. Values must be among `"html"`, `"rendered"`, and `"html_rendered"`. `NULL` keeps all origins present in `bundle$edges`. Unlike placement, link origin *is* a Screaming Frog concept and stays wrapper-owned.

weight_col

Optional existing edge weight column, forwarded to [pagerank()]. Cannot be combined with `placement_weights`.

apply_canonicals

Logical flag (default `TRUE`). When `TRUE` the bundle's `rel=canonical` signals are folded into the graph via [pagerank()]'s `canonicals_df`. Set `FALSE` for an as-crawled run that preserves the crawled node identities (no canonical folding) — useful when canonicals point off the crawled domain (e.g. a mirror/staging host) and would otherwise relabel crawled pages onto uncrawled targets.

apply_redirects

Logical flag (default `TRUE`). When `TRUE` the bundle's redirect signals are folded into the graph via [pagerank()]'s `redirects_df`. Set `FALSE` to skip redirect folding and keep the as-crawled node identities.

preset

Optional named view forwarded to [pagerank()]'s `preset`, one of `"raw"`, `"declared"`, `"reversed"`, `"content"`, or a [pr_preset()] result. The `"raw"` view additionally switches off the bundle's declared canonical, redirect and indexability tables, since "the graph exactly as crawled" cannot honor declarations the wrapper would otherwise feed in. An explicit `apply_canonicals` or `apply_redirects` still overrides the `"raw"` default for that table. See `vignette("presets")`.

...

Additional scoring controls passed to [pagerank()], such as `self_loops`, `drop_isolates_flag`, `nofollow_action`, `robots_blocked_action`, `rurl_params`, prior settings, and `damping`. Positional decay is opt-in here too: the bundle's `edges` carry a `position_index` column (each link's reading-order rank among its source page's content links, materialized only from an **All Outlinks** export), so pass `position_col = "position_index"` – optionally with `position_transform` / `position_alpha` / `position_floor` – to switch the axis on. It stays off by default, per the faithful-default rule, because reading-order decay reshuffles ranking as hard as placement weighting does.

Value

The [pagerank()] result data frame. It retains the `"transition_audit"` attribute from [pagerank()] and adds a `"screaming_frog_import"` attribute containing bundle diagnostics, provenance, and wrapper filtering/weighting choices.

Examples

internal <- data.frame(
  Address = c("https://example.com/", "https://example.com/a"),
  `Status Code` = c("200", "200"),
  check.names = FALSE
)
links <- data.frame(
  Type = "Hyperlink",
  Source = "https://example.com/",
  Destination = "https://example.com/a",
  Follow = "TRUE",
  check.names = FALSE
)
bundle <- screaming_frog_bundle(internal, links, "all_outlinks")
pagerank_screaming_frog(bundle)
#>               node_name  pagerank page_state wasted_mass
#> 1  https://example.com/ 0.3508772       live           0
#> 2 https://example.com/a 0.6491228       live           0