This function checks a directory to ascertain if it has the required files
(.Rproj
and DESCRIPTION
) configured correctly for an R package. It
provides verbose output detailing which checks have passed or failed.
Value
A logical value; TRUE
if both .Rproj
and DESCRIPTION
files
are configured correctly, FALSE
otherwise.
Details
This function wraps around is_pkg_description
and is_pkg_rproj
functions to check both the DESCRIPTION
and .Rproj
files. If verbose
is TRUE
, it will use cli
package functions to alert the user about the
checks being performed and their results.
Examples
is_r_package(
system.file("pkg", package = "shinypak"),
verbose = TRUE)
#> ℹ Checking DESCRIPTION for package fields
#> ✔ Package, Version, License, Description, Title, Author, and Maintainer found!
#> ℹ Checking .Rroj for project build fields
#> ✖ BuildType, PackageUseDevtools, and PackageInstallArgs not in .Rproj!
#> ✖ '' is not configured as an R package
#> [1] FALSE
is_r_package(
system.file("app", package = "shinypak"),
verbose = TRUE)
#> ℹ Checking DESCRIPTION for package fields
#> ✔ Package, Version, License, Description, Title, Author, and Maintainer found!
#> ℹ Checking .Rroj for project build fields
#> ✖ BuildType, PackageUseDevtools, and PackageInstallArgs not in .Rproj!
#> ✖ '' is not configured as an R package
#> [1] FALSE