From b50e5eeca5e00acf6f8290f796f62e3db3fd57d8 Mon Sep 17 00:00:00 2001 From: Davis Vaughan Date: Sat, 16 Nov 2019 07:26:35 -0500 Subject: [PATCH] Remove backports (#672) --- DESCRIPTION | 1 - R/utils.R | 6 +++++- R/zzz.R | 2 -- tests/testthat/test-type.R | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 57c1962a8..17bf1e5ef 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -26,7 +26,6 @@ BugReports: https://github.com/r-lib/vctrs/issues Depends: R (>= 3.2) Imports: - backports, ellipsis (>= 0.2.0), digest, glue, diff --git a/R/utils.R b/R/utils.R index 7fd2ff68a..611a520e2 100644 --- a/R/utils.R +++ b/R/utils.R @@ -1,5 +1,9 @@ +str_dup <- function(x, times) { + paste0(rep(x, times = times), collapse = "") +} + indent <- function(x, n) { - pad <- strrep(" ", n) + pad <- str_dup(" ", n) map_chr(x, gsub, pattern = "(\n+)", replacement = paste0("\\1", pad)) } diff --git a/R/zzz.R b/R/zzz.R index b808a5606..2676072f4 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -1,7 +1,5 @@ # nocov start .onLoad <- function(libname, pkgname) { - backports::import(pkgname, "strrep") - s3_register("generics::as.factor", "vctrs_vctr") s3_register("generics::as.ordered", "vctrs_vctr") s3_register("generics::as.difftime", "vctrs_vctr") diff --git a/tests/testthat/test-type.R b/tests/testthat/test-type.R index d8c99639f..4b0527d1d 100644 --- a/tests/testthat/test-type.R +++ b/tests/testthat/test-type.R @@ -57,7 +57,7 @@ test_that("vec_ptype_common() includes index in argument tag", { df2 <- tibble(x = tibble(y = tibble(z = "a"))) # Create a column name too large for default buffer - nm <- strrep("foobarfoobar", 10) + nm <- str_dup("foobarfoobar", 10) large_df1 <- set_names(df1, nm) large_df2 <- set_names(df2, nm)