@@ -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-
2112is_windows <- isTRUE(.Platform $ OS.type == " windows" )
2213
2314sort_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-
6029vcapply <- function (x , FUN , ... ) {
6130 vapply(x , FUN , FUN.VALUE = character (1 ), ... )
6231}
0 commit comments