diff --git a/DESCRIPTION b/DESCRIPTION index e422614..2479d3e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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 = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")), person("Wush", "Wu", role = "ctb"), @@ -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, diff --git a/R/zzz.R b/R/zzz.R index 9e38985..489acd8 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -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) }