Skip to contents

Modifies an extendr package to use CRAN compliant settings.

Usage

use_cran_defaults(path = ".", quiet = FALSE, overwrite = NULL, lib_name = NULL)

vendor_pkgs(path = ".", quiet = FALSE, overwrite = NULL)

Arguments

path

File path to the package for which to generate wrapper code.

quiet

Logical indicating whether any progress messages should be generated or not.

overwrite

Logical scalar or NULL indicating whether the files in the path should be overwritten. If NULL (default), the function will ask the user whether each file should be overwritten in an interactive session or do nothing in a non-interactive session. If FALSE and each file already exists, the function will do nothing. If TRUE, all files will be overwritten.

lib_name

String that is used as the name of the Rust library. If NULL, sanitized R package name is used instead.

Value

  • vendor_pkgs() returns a data.frame with two columns crate and version

  • use_cran_defaults() returns NULL and is used solely for its side effects

Details

use_cran_defaults() modifies an existing package to provide CRAN complaint settings and files. It creates tools/msrv.R, configure and configure.win files as well as modifies Makevars and Makevars.win to use required CRAN settings.

vendor_pkgs() is used to package the dependencies as required by CRAN. It executes cargo vendor on your behalf creating a vendor/ directory and a compressed vendor.tar.xz which will be shipped with package itself. If you have modified your dependencies, you will need need to repackage

Examples


if (interactive()) {
  use_cran_defaults()
  vendor_pkgs()
}