R/remove_domain.R

Defines functions remove_domain

Documented in remove_domain

#' function to remove domain from path
#' @param x path aka URL from which to first infer domain and then remove it
remove_domain <- function(x){
  unlist(lapply(
    x,
    function(x){
      if( is.na(x) ){
        return(x)
      }else{
        stringr::str_replace(x, paste0("^.*", "\\Q", guess_domain(x), "\\E"), "")
      }
    }
  ))
}

Try the robotstxt package in your browser

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

robotstxt documentation built on Sept. 4, 2020, 1:08 a.m.