installLocalPackageIfChanged: Install Local Package If Changed

View source: R/package_ops.R

installLocalPackageIfChangedR Documentation

Install Local Package If Changed

Description

Reinstalls a local R package if it is not already installed or if files in the package directory have changed since the last snapshot. Useful for automating package installation during development.

Usage

installLocalPackageIfChanged(pkg_path, snapshot_path)

Arguments

pkg_path

Character string. Path to the local R package directory.

snapshot_path

Character string. Path to the snapshot file used for change detection.

Details

The function checks whether the specified package is installed and whether any files in the directory have changed. If needed, the package is reinstalled and the snapshot is updated.

Value

Invisibly returns NULL. Installs the package and updates the snapshot if needed.

See Also

installLocalPackage, saveRDS

Examples

## Not run: 
installLocalPackageIfChanged(
  pkg_path = "./Rpackage/IMPACTncd_Engl_model_pkg/",
  snapshot_path = "./Rpackage/.IMPACTncd_Engl_model_pkg_snapshot.rds"
)

## End(Not run)


ChristK/CKutils documentation built on April 11, 2025, 10:11 p.m.