Skip to content

Commit

Permalink
better regex in classify
Browse files Browse the repository at this point in the history
  • Loading branch information
JBGruber committed Nov 6, 2023
1 parent 69e165c commit 7de0c0f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ pb_available <- function(...) {
#' not as is sounds, turns urls into class conform string
#' @noRd
classify <- function(url) {
url <- sub("^www\\.", "", as.factor(url)) # here for data collected with older version of paperboy
# as.factor improves speed
replace_all(as.factor(url), c(".", "-"), rep("_", 2L), fixed = TRUE)
url <- sub("^www\\.", "", as.factor(url)) # remove www for compatibility
gsub("\\.|\\-", "_", as.factor(url))
}


Expand Down

0 comments on commit 7de0c0f

Please sign in to comment.