Skip to content

Commit 3cbccfc

Browse files
committed
r-devel apparently doesn't yet have grid::unitType()
1 parent daf0c35 commit 3cbccfc

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

R/ggplotly.R

+1-4
Original file line numberDiff line numberDiff line change
@@ -1157,11 +1157,8 @@ verifyUnit <- function(u) {
11571157
# Use public API for getting the unit's type, if available
11581158
# https://github.com/ropensci/plotly/pull/1646#issue-331268260
11591159
getUnitType <- function(u) {
1160-
if (getRversion() >= "4.0.0") {
1161-
get("unitType", envir = asNamespace("grid"))(u)
1162-
} else {
1160+
tryNULL(get("unitType", envir = asNamespace("grid"))) %||%
11631161
attr(u, "unit")
1164-
}
11651162
}
11661163

11671164
# detect a blank theme element

0 commit comments

Comments
 (0)