Skip to content

Commit 946e4a9

Browse files
Remove unused internal utilities (#2453)
1 parent a7f407f commit 946e4a9

1 file changed

Lines changed: 0 additions & 31 deletions

File tree

R/utils.R

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,6 @@ compact <- function(x) {
99
get(f, envir = asNamespace(p))
1010
}
1111

12-
# Modified version of utils::file_ext. Instead of always returning the text
13-
# after the last '.', as in "foo.tar.gz" => ".gz", if the text that directly
14-
# precedes the last '.' is ".tar", it will include also, so
15-
# "foo.tar.gz" => ".tar.gz"
16-
file_ext <- function(x) {
17-
pos <- regexpr("\\.((tar\\.)?[[:alnum:]]+)$", x)
18-
ifelse(pos > -1L, substring(x, pos + 1L), "")
19-
}
20-
2112
is_windows <- isTRUE(.Platform$OS.type == "windows")
2213

2314
sort_ci <- function(x) {
@@ -35,28 +26,6 @@ is_attached <- function(pkg = ".") {
3526
!is.null(pkgload::pkg_env(pkg$package))
3627
}
3728

38-
# This is base::trimws from 3.2 on
39-
trim_ws <- function(x, which = c("both", "left", "right")) {
40-
which <- match.arg(which)
41-
mysub <- function(re, x) sub(re, "", x, perl = TRUE)
42-
if (which == "left") {
43-
return(mysub("^[ \t\r\n]+", x))
44-
}
45-
if (which == "right") {
46-
return(mysub("[ \t\r\n]+$", x))
47-
}
48-
mysub("[ \t\r\n]+$", mysub("^[ \t\r\n]+", x))
49-
}
50-
51-
menu <- function(...) {
52-
utils::menu(...)
53-
}
54-
55-
escape_special_regex <- function(x) {
56-
chars <- c("*", ".", "?", "^", "+", "$", "|", "(", ")", "[", "]", "{", "}", "\\")
57-
gsub(paste0("([\\", paste0(collapse = "\\", chars), "])"), "\\\\\\1", x, perl = TRUE)
58-
}
59-
6029
vcapply <- function(x, FUN, ...) {
6130
vapply(x, FUN, FUN.VALUE = character(1), ...)
6231
}

0 commit comments

Comments
 (0)