Skip to contents

A utility function to help you build your approved packages and functions list. This can be used by logrx to log unapproved use of packages and functions.

Usage

build_approved(pkg_list, file = NULL)

Arguments

pkg_list

Named list of character vectors:

  • Name is the package name

  • Value is a character vector of approved functions or 'All'

file

String. Name of file where the approved tibble will be written to. If not specified, the tibble is returned

Default: NULL

Permitted Files: .RDS

Value

Tibble with two columns (library, function) and one row per function

Details

For more details see the vignette: vignette("approved", package = "logrx")

Examples

approved_pkgs <- list(
  base = c("library", "mean"),
  dplyr = "All"
)

# build and return
build_approved(approved_pkgs)
#> # A tibble: 295 × 2
#>    function_name         library      
#>    <chr>                 <chr>        
#>  1 library               package:base 
#>  2 mean                  package:base 
#>  3 slice_max             package:dplyr
#>  4 expr                  package:dplyr
#>  5 src                   package:dplyr
#>  6 db_desc               package:dplyr
#>  7 group_by_drop_default package:dplyr
#>  8 db_commit             package:dplyr
#>  9 coalesce              package:dplyr
#> 10 data_frame            package:dplyr
#> # ℹ 285 more rows

# build and save
dir <- tempdir()
build_approved(approved_pkgs, file.path(dir, "approved.rds"))