Skip to contents

Maps Screaming Frog's "Link Position" values onto the compact vocabulary pagerankr uses for placement-aware weighting: navigation becomes "nav", while header, footer, aside, and content pass through unchanged. Matching is case-insensitive and whitespace is trimmed. The result is what [pagerank()] consumes through its placement_col argument.

Usage

sf_normalize_position(x)

Arguments

x

A vector (typically character) of link positions.

Value

A character vector the same length as x containing "nav", "header", "footer", "aside", or "content". Blank strings, NA, and unrecognized values yield NA.

Examples

sf_normalize_position(c("Navigation", "Aside", "Content", "", NA))
#> [1] "nav"     "aside"   "content" NA        NA