Skip to content

Commit

Permalink
backport trimws from R 3.2.0 to 3.1.0 (#3114)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdowle authored Oct 18, 2018
1 parent 0987f51 commit 6419f8a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions R/data.table.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@

if (!exists("trimws", "package:base")) {
# trimws was new in R 3.2.0. Backport it for internal data.table use in R 3.1.0
trimws <- function(x) {
mysub <- function(re, x) sub(re, "", x, perl = TRUE)
mysub("[ \t\r\n]+$", mysub("^[ \t\r\n]+", x))
}
}

dim.data.table <- function(x)
{
.Call(Cdim, x)
Expand Down

0 comments on commit 6419f8a

Please sign in to comment.