Skip to content

Commit e018be8

Browse files
committed
remove old backport unitType()
1 parent 28af4a3 commit e018be8

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

R/backports.R

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,6 @@ if (getRversion() < "3.3") {
1717

1818
on_load(backport_unit_methods())
1919

20-
unitType <- function(x) {
21-
unit <- attr(x, "unit")
22-
if (!is.null(unit)) {
23-
return(unit)
24-
}
25-
if (is.list(x) && is.unit(x[[1]])) {
26-
unit <- vapply(x, unitType, character(1))
27-
return(unit)
28-
} else if ("fname" %in% names(x)) {
29-
return(x$fname)
30-
}
31-
rep("", length(x)) # we're only interested in simple units for now
32-
}
33-
34-
on_load({
35-
if ("unitType" %in% getNamespaceExports("grid")) {
36-
unitType <- grid::unitType
37-
}
38-
})
39-
4020
# isFALSE() and isTRUE() are available on R (>=3.5)
4121
if (getRversion() < "3.5") {
4222
isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x

0 commit comments

Comments
 (0)