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/RtmpAM3FIu".
#> ✔ Creating R/.
#> ✔ Writing DESCRIPTION.
#> Package: RtmpAM3FIu
#> 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
#> Encoding: UTF-8
#> Roxygen: list(markdown = TRUE)
#> RoxygenNote: 8.0.0
#> ✔ Writing NAMESPACE.
#> ✔ Setting active project to "<no active project>".
use_r_v4.1.0(path = tmpdir)
#> ✔ Setting active project to "/tmp/RtmpAM3FIu".
#> ✔ Adding R to Depends field in DESCRIPTION.
# }
