Normalize a Screaming Frog link position
Source:R/screaming_frog_contract.R
sf_normalize_position.RdMaps 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.
Value
A character vector the same length as x containing
"nav", "header", "footer", "aside", or
"content". Blank strings, NA, and unrecognized values yield
NA.
See also
Other Screaming Frog toolkit:
sf_container_from_path(),
sf_contract(),
sf_graph_eligible(),
sf_parse_follow(),
sf_read_input(),
sf_region_from_path(),
sf_rel_nofollow()
Examples
sf_normalize_position(c("Navigation", "Aside", "Content", "", NA))
#> [1] "nav" "aside" "content" NA NA