sf_read_input: Read a Screaming Frog export into a normalized data frame

View source: R/screaming_frog_contract.R

sf_read_inputR Documentation

Read a Screaming Frog export into a normalized data frame

Description

Reads a Screaming Frog export – either an in-memory data frame or a path to a CSV/Excel file – and returns it with canonical snake_case column names, validated against the schema for export_kind. Header aliases are resolved (e.g. "Address", "URL", and "URI" all map to address), empty strings become NA, and character columns are trimmed.

Usage

sf_read_input(x, export_kind, fields = NULL)

Arguments

x

A data frame, or a path to a Screaming Frog CSV/Excel export.

export_kind

Character, which export is being read. One of sf_contract()$export_kinds: "internal_all", "all_inlinks", or "all_outlinks".

fields

Optional character vector of additional (non-required) fields to retain beyond the schema's required set. Default NULL keeps the schema's standard field order.

Value

A data frame with canonical snake_case columns. The resolved schema is attached as the "sf_schema" attribute, a list of export_kind, columns, aliases, and ignored_columns.

See Also

Other Screaming Frog toolkit: sf_container_from_path(), sf_contract(), sf_graph_eligible(), sf_normalize_position(), sf_parse_follow(), sf_region_from_path(), sf_rel_nofollow()

Examples

crawl <- data.frame(
  Address = c("https://example.com/", "https://example.com/a"),
  `Status Code` = c(200, 200),
  check.names = FALSE
)
out <- sf_read_input(crawl, "internal_all")
names(out)
attr(out, "sf_schema")$export_kind

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