new_transition_audit: Construct a transition_audit object

View source: R/transition_audit.R

new_transition_auditR Documentation

Construct a transition_audit object

Description

Internal constructor used by [pagerank()] to assemble the audit record from counts gathered along the aggregation / validation / cleaning path. Every argument has a default so that partially-known states (e.g. an empty edge list) still produce a well-formed object with the documented fields present.

Usage

new_transition_audit(
  n_input_rows = 0L,
  n_edges = 0L,
  n_vertices = 0L,
  weighted = FALSE,
  weight_col = NULL,
  n_edges_weighted = 0L,
  duplicate_edge_policy = "collapse",
  instance_count_col = NULL,
  n_duplicate_instances = 0L,
  duplicate_edges = NULL,
  n_rows_na = 0L,
  n_rows_duplicate = 0L,
  n_self_loops = 0L,
  n_prior_unmatched = NA_integer_,
  n_robots_blocked = 0L,
  n_status_dead = 0L,
  pagerank_total = NA_real_,
  mass_reported = NA_real_,
  mass_evaporated = NA_real_,
  mass_leaked = NA_real_,
  mass_hidden = NA_real_,
  out_of_scope_fold = "relabel",
  n_out_of_scope_folds = 0L,
  out_of_scope_folds_applied = TRUE,
  out_of_scope_fold_list = NULL,
  fold_collisions = NULL,
  config = list()
)

Arguments

n_input_rows

Integer, rows in the raw 'edge_list_df'.

n_edges

Integer, directed edges that survived folding, dedup and self-loop handling (the edges actually scored).

n_vertices

Integer, vertices in the returned result.

weighted

Logical, whether an edge 'weight_col' was in effect.

weight_col

Character or 'NULL', the weight column name.

n_edges_weighted

Integer, edges carrying a finite positive weight.

duplicate_edge_policy

Character, the duplicate-edge policy used by [pagerank()].

instance_count_col

Character or 'NULL', internal count column used by 'duplicate_edge_policy = "count_instances"'.

n_duplicate_instances

Integer, duplicate link instances folded into transition weights.

duplicate_edges

Data frame or 'NULL', compact counted-edge audit rows.

n_rows_na

Integer, input rows dropped due to 'NA' endpoints.

n_rows_duplicate

Integer, rows collapsed by deduplication.

n_self_loops

Integer, self-loop edges dropped.

n_prior_unmatched

Integer or 'NA', prior URLs that did not fold onto a vertex.

n_robots_blocked

Integer, URLs treated as robots.txt-blocked.

n_status_dead

Integer, in-graph URLs whose HTTP status code marked them response-dead (4xx/5xx).

pagerank_total

Numeric, sum of the returned PageRank scores.

mass_reported

Numeric, stationary mass on returned/visible pages (typically equal to 'pagerank_total').

mass_evaporated

Numeric, stationary mass routed to the shared waste sink (authority the waste class and every real nofollowed link passed on but could not deliver). '0' when nothing reached the sink.

mass_leaked

Numeric, stationary mass sent to the leak sink under 'out_of_scope_fold = "leak"' (authority that flowed into out-of-scope-folded sources, treated like an external redirect). '0' when no leak occurred.

mass_hidden

Numeric, the own stationary mass of vanished robots-blocked nodes removed from the results (their pass-through is counted in 'mass_evaporated', not here). '0' when none.

out_of_scope_fold

Character, the 'out_of_scope_fold' policy used ('"relabel"', '"keep"' or '"leak"').

n_out_of_scope_folds

Integer, count of composed fold-map entries whose target was not a crawled node.

out_of_scope_folds_applied

Logical, 'TRUE' when the out-of-scope folds were acted upon (relabeled under '"relabel"', or routed to the leak sink under '"leak"'), 'FALSE' when they were skipped (kept) under '"keep"'.

out_of_scope_fold_list

Data frame or 'NULL', the out-of-scope folds as 'source' / 'target' / 'signal' rows.

fold_collisions

Data frame or 'NULL', fold-target collisions detected on the pre-fold edge list: rows of 'target' / 'n_independent_refs' / 'source' for uncrawled URLs that a fold relabeled a crawled source onto while they were also independently linked. 'NULL' when no 'indexability_df' crawl-URL set was available to detect them.

config

A named list of the relevant [pagerank()] configuration.

Value

An object of class '"transition_audit"' (see [transition_audit]).

Examples

# Low-level plumbing: normally you obtain a transition_audit via
# attr(pagerank(...), "transition_audit") rather than by hand. Every
# argument defaults, so a bare call yields a well-formed, empty-graph object.
audit <- new_transition_audit()
audit$counts

# Populate a few fields to describe a small scored graph.
audit <- new_transition_audit(
  n_input_rows = 4L,
  n_edges = 3L,
  n_vertices = 3L,
  n_rows_duplicate = 1L,
  pagerank_total = 1,
  mass_reported = 1
)
audit$counts$n_edges
audit$dropped$n_rows_collapsed

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