Skip to contents

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.

Usage

is_r_package(path, verbose = FALSE)

Arguments

path

A character string specifying the path to the directory to be checked.

verbose

A logical parameter; if set to TRUE, detailed messages will be displayed during the check.

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