README.md

pagerankr: SEO-Focused PageRank Modeling Toolkit

1 pagerankr pagerankr hex sticker

CRAN
status CRAN
downloads Lifecycle:
experimental OpenSSF Best
Practices Pipeline
status Documentation Coverage

pagerankr is an SEO-focused R toolkit for PageRank modeling on crawl data. It supports both a single end-to-end wrapper (pagerank()) and modular building blocks for cleaning URLs, auditing redirects, resolving link graphs, running scenario comparisons, and exporting graph outputs.

The package currently includes:

1.1 Installation

# From CRAN
install.packages("pagerankr")

# Development version from GitLab
# install.packages("devtools")
devtools::install_gitlab("bart-turczynski/pagerankr")

1.2 Quick Start

library(pagerankr)

edges <- data.frame(
  from = c("http://example.com/home",
           "http://example.com/about",
           "http://example.com/blog"),
  to   = c("http://example.com/about",
           "http://example.com/home",
           "http://example.com/home")
)

redirects <- data.frame(
  from = "http://example.com/old-blog",
  to   = "http://example.com/blog"
)

pr <- pagerank(edges, redirects_df = redirects)
print(pr)

1.3 Current Capabilities

1.3.1 Crawl Data Prep and Redirect QA

audit <- audit_redirects(redirects, edge_list_df = edges)
print(audit)

resolve_redirect_urls(
  c("http://example.com/old-blog", "http://example.com/home"),
  redirects
)

1.3.2 Screaming Frog Crawl Imports

Use screaming_frog_bundle() with an Internal: All export and either All Inlinks or All Outlinks. The node export supplies page facts, redirects, canonicals, and indexability. The link export supplies raw link observations and graph-eligible Hyperlink edges. Resource, canonical, hreflang, and other non-Hyperlink link rows are retained in diagnostics but excluded from the PageRank graph by default.

bundle <- screaming_frog_bundle(
  internal = "internal_all.csv",
  links = "all_outlinks.csv",
  link_export_kind = "all_outlinks"
)

pr <- pagerank_screaming_frog(bundle)
attr(pr, "screaming_frog_import")
attr(pr, "transition_audit")

Placement and rendered-vs-HTML policies are explicit scoring choices:

pagerank_screaming_frog(
  bundle,
  accepted_placements = c("nav", "content"),
  link_origins = c("html", "html_rendered"),
  placement_weights = c(nav = 2, content = 1)
)

1.3.3 PageRank Modeling Controls

edges_w <- data.frame(
  from = c("Home", "Home", "Home"),
  to = c("About", "Blog", "Contact"),
  position = c(1, 2, 5)
)

edges_w$weight <- transform_weights(
  edges_w$position,
  method = "zipf",
  descending = FALSE
)

pagerank(edges_w, weight_col = "weight", clean_edge_urls = FALSE)

1.3.4 Comparison, Grid Search, and Simulation

grid <- auto_grid(
  damping = c(0.85, 0.95),
  nofollow_action = c("evaporate", "drop")
)

grid_results <- pagerank_grid(edges, params_grid = grid, clean_edge_urls = FALSE)
analyze_pagerank_grid(grid_results)

1.3.5 Export and Exploration

pr <- pagerank(edges, clean_edge_urls = FALSE)
export_graph(pr, edges, file = "pagerank.graphml", format = "graphml")

# Optional interactive app:
# install.packages(c("shiny", "DT", "visNetwork"))
# launch_pagerank_explorer()

1.4 Key Functions

| Function | Purpose | |:---|:---| | pagerank() | End-to-end PageRank pipeline | | compute_pagerank() | Low-level wrapper around igraph::page_rank() | | resolve_links() | Resolve redirects and deduplicate graph without PR | | resolve_redirects() | Apply redirect rules to an edge list | | resolve_redirect_urls() | Resolve standalone URL vectors through redirects | | resolve_canonicals() | Apply rel=canonical folds to edge endpoints | | resolve_folded_urls() | Resolve URL vectors through redirects plus canonicals | | audit_redirects() | Diagnose redirect chains, loops, and conflicts | | screaming_frog_bundle() | Compose Screaming Frog node and link exports | | pagerank_screaming_frog() | Score a Screaming Frog bundle via pagerank() | | clean_url_columns() | Canonicalize URL columns in data frames | | get_unique_edges() | Deduplicate edges and handle self-loops | | drop_isolates() | Build vertex sets with or without isolates | | filter_links_by_domain() | Filter edges by keep/ignore domain or host lists | | transform_weights() | Transform raw signals into PageRank edge weights | | compare_pagerank() | Compare two PageRank outputs with rank deltas | | simulate_changes() | Evaluate proposed link/redirect changes | | auto_grid() | Build exhaustive parameter grids | | pagerank_grid() | Run PageRank across multiple parameter sets | | analyze_pagerank_grid() | Summarize PageRank distribution by model | | pr_gini() | Gini concentration metric | | pr_entropy() | Entropy dispersion metric | | pr_top_k_share() | Top-k PageRank concentration share | | export_graph() | Export graph and PageRank metadata for external tools | | launch_pagerank_explorer() | Start the interactive Shiny explorer | | hits() | End-to-end HITS hub + authority scores | | compute_hits() | Low-level igraph HITS wrapper | | salsa() | End-to-end SALSA hub + authority scores | | compute_salsa() | Low-level SALSA computational core | | trustrank() | TrustRank: seed-biased PageRank from a trusted seed set | | topic_sensitive_pagerank() | Per-topic personalized PageRank with blended scores | | topic_feeder_pagerank() | Reverse-graph seeded PR: find pages that feed a cluster | | seed_prior() | Build a teleport prior from a seed set (for trustrank / topic_feeder_pagerank) | | align_prior_to_vertices() | Align a prior/teleport data frame to the graph vertex set | | damping_sensitivity() | Sweep PageRank across a range of damping factors | | pagerank_stability() | Alpha-stability report: rank correlation across a damping grid | | ga4_page_transitions() | Consecutive page-view transition counts from a GA4 export | | smooth_transitions() | Shrink sparse empirical transitions toward a structural prior | | ga4_entrance_teleport() | Entrance/landing-page counts as a PageRank teleport vector | | aggregate_edges() | Aggregate duplicate edges after URL folding | | transform_edge_weights() | Per-source grouped edge weight transforms | | validate_edge_weights() | Validate per-source weight totals | | screaming_frog_internal() | Import Screaming Frog Internal: All export | | screaming_frog_links() | Import Screaming Frog All Inlinks / All Outlinks export | | audit_redirects() | Diagnose redirect chains, loops, and conflicts | | audit_canonicals() | Diagnose rel=canonical fold coverage and conflicts | | resolve_canonicals() | Apply rel=canonical folds to an edge list | | resolve_canonical_urls() | Resolve a URL vector through rel=canonical folds | | resolve_folded_urls() | Resolve a URL vector through redirects plus canonicals |

1.5 Further Information

The reference and vignettes ship with the package and are reachable through help(package = "pagerankr") and the vignette() calls below; the rendered website is being rebuilt after the move to GitLab. To report a bug or request an enhancement, use GitLab Issues. Please read CONTRIBUTING.md before proposing a change; it sets out the test, lint, and R CMD check requirements. For privately reported security vulnerabilities, follow SECURITY.md.

help(package = "pagerankr")
vignette("pagerankr-usage")
vignette("trustrank")
vignette("topic_feeder_pagerank")

1.6 Code of Conduct

Please note that the pagerankr project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

1.7 License

MIT License. See the LICENSE file for details.



Try the pagerankr package in your browser

Any scripts or data that you put into this service are public.

pagerankr documentation built on Oct. 1, 2026, 5:09 p.m.