Adds R (>= 4.1.0) to the Depends field of a package's DESCRIPTION file.
This sets a minimum R version requirement for your package. Then you can use
\() and |> syntax in your package.
Requires that the target directory is an R package root (contains a
DESCRIPTIONfile).Calls
usethis::use_package()to add the dependency.
Examples
# \donttest{
tmpdir <- tempdir()
usethis::create_package(path = tmpdir)
#> ✔ Setting active project to "/tmp/RtmpEsKggO".
#> ℹ Leaving DESCRIPTION unchanged.
#> Package: RtmpEsKggO
#> Title: What the Package Does (One Line, Title Case)
#> Version: 0.0.0.9000
#> Authors@R (parsed):
#> * First Last <first.last@example.com> [aut, cre]
#> Description: What the package does (one paragraph).
#> License: `use_mit_license()`, `use_gpl3_license()` or friends to
#> pick a license
#> Config/roxygen2/version: 8.1.0
#> Encoding: UTF-8
#> Roxygen: list(markdown = TRUE)
#> ✔ Setting active project to "/tmp/RtmpEsKggO".
use_r_v4.1.0(path = tmpdir)
#> ✔ Adding R to Depends field in DESCRIPTION.
# }
