From eb9f55ceb4df237bbc9b0fb3c7c6bc9971f5ecb7 Mon Sep 17 00:00:00 2001 From: Jenny Bryan Date: Tue, 19 Nov 2024 19:24:50 -0800 Subject: [PATCH] Never lower minimum R version via use_data() --- R/data.R | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/R/data.R b/R/data.R index 5003c0c77..b7d44165f 100644 --- a/R/data.R +++ b/R/data.R @@ -44,11 +44,13 @@ use_data <- function(..., objs <- get_objs_from_dots(dots(...)) - if (version < 3) { - use_dependency("R", "depends", "2.10") - } else { - use_dependency("R", "depends", "3.5") + original_minimum_r_version <- pkg_minimum_r_version() + serialization_minimum_r_version <- if (version < 3) "2.10" else "3.5" + if (is.na(original_minimum_r_version) || + original_minimum_r_version < serialization_minimum_r_version) { + use_dependency("R", "depends", serialization_minimum_r_version) } + if (internal) { use_directory("R") paths <- path("R", "sysdata.rda")