Skip to content

Commit be93615

Browse files
krlmlrhadley
authored andcommitted
Use get() instead of getS3method() for R < 3.3 (#205)
* use get() instead of getS3method() for R < 3.3 * NEWS
1 parent 059fb35 commit be93615

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# tidyr 0.5.0.9000
22

3+
* Restored compatibility with R < 3.3.0 by avoiding `getS3method(envir = )` (#205, @krlmlr).
4+
5+
36
# tidyr 0.5.0
47

58
## New functions

R/spread.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ col_names <- function(x, sep = NULL) {
147147
}
148148

149149
as_data_frame_matrix <- function(x) {
150-
utils::getS3method("as_data_frame", "matrix", envir = asNamespace("tibble"))(x)
150+
# getS3method() only available in R >= 3.3
151+
get("as_data_frame.matrix", asNamespace("tibble"), mode = "function")(x)
151152
}
152153

153154
#' @export

0 commit comments

Comments
 (0)