Skip to content

Commit

Permalink
support lower versions of R
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Aug 2, 2024
1 parent cb24413 commit 350984a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 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.4
Version: 0.46.5
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 Down
5 changes: 5 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -356,3 +356,8 @@ handle_error = function(

# a shorthand for rm(list =, envir =)
rm_vars = function(x, envir, ...) rm(list = x, envir = envir, ...)

# for R < 3.3.x
if (!exists('startsWith', baseenv(), inherits = TRUE)) startsWith = function(x, s) {
substring(x, 1, nchar(s)) == s
}

0 comments on commit 350984a

Please sign in to comment.