Skip to content

Commit

Permalink
remove functions that are available in R 3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Aug 2, 2024
1 parent d1390a0 commit 8d7e092
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: xfun
Type: Package
Title: Supporting Functions for Packages Maintained by 'Yihui Xie'
Version: 0.46.7
Version: 0.46.8
Authors@R: c(
person("Yihui", "Xie", role = c("aut", "cre", "cph"), email = "[email protected]", comment = c(ORCID = "0000-0003-0645-5666")),
person("Wush", "Wu", role = "ctb"),
Expand All @@ -13,6 +13,7 @@ Authors@R: c(
person()
)
Description: Miscellaneous functions commonly used in other packages maintained by 'Yihui Xie'.
Depends: R (>= 3.2.0)
Imports: grDevices, stats, tools
Suggests:
testit,
Expand Down
8 changes: 0 additions & 8 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ if (!has_fun('endsWith')) endsWith = function(x, s) {
n = nchar(x)
substring(x, n - nchar(s) + 1, n) == s
}
if (!has_fun('anyNA')) anyNA = function(x) any(is.na(x))
if (!exists('trimws', baseenv(), inherits = FALSE)) trimws = function(x, which = 'both') {
r = c(both = '^\\s+|\\s+$', right = '\\s+$', left = '^\\s+')[which]
gsub(r, '', x)
}
if (!exists('file.size', baseenv(), inherits = FALSE)) file.size = function(...) {
file.info(...)$size
}
if (!has_fun('strrep')) strrep = function(x, times) {
mapply(function(x, n) paste(rep(x, n), collapse = ''), x, times, USE.NAMES = FALSE)
}

0 comments on commit 8d7e092

Please sign in to comment.