addPackage: Add SyncroSim package(s)

addPackageR Documentation

Add SyncroSim package(s)

Description

Adds package(s) to a SsimLibrary.

Usage

addPackage(ssimLibrary, packages, versions = NULL, forceUpdate = FALSE)

## S4 method for signature 'character'
addPackage(ssimLibrary, packages, versions = NULL, forceUpdate = FALSE)

## S4 method for signature 'SsimLibrary'
addPackage(ssimLibrary, packages, versions = NULL, forceUpdate = FALSE)

Arguments

ssimLibrary

SsimLibrary object

packages

character string or vector of package name(s)

versions

character string or vector of package version(s). If NULL then uses the latest installed version of the package

forceUpdate

logical. If FALSE (default) user will be prompted to approve any required updates. If TRUE, required updates will be applied silently.

Value

Invisibly returns TRUE upon success (i.e.successful addition of the package) or FALSE upon failure.

See Also

packages

Examples

## Not run: 
# Install "stsim" and "stsimecodep" SyncroSim packages
installPackage(packages = c("stsim", "stsim"),
               versions = c("4.0.0", "4.0.1"))
installPackage("stsimecodep")

# Specify file path and name of new SsimLibrary
myLibraryName <- file.path(tempdir(), "testlib")

# Set up a SyncroSim Session, SsimLibrary, and Project
mySession <- session()
myLibrary <- ssimLibrary(name = myLibraryName, session = mySession)

# Add package
addPackage(myLibrary, packages = "stsim", versions = "4.0.1")
addPackage(myLibrary, packages = "stsimecodep")
packages(myLibrary)

# Change package version
addPackage(myLibrary, packages = "stsim", versions = "4.0.0")
addPackage(myLibrary, packages = "stsim", versions = "4.0.1")

# Remove package
removePackage(myLibrary, packages = c("stsim", "stsimecodep"))
packages(myLibrary)

## End(Not run)


syncrosim/rsyncrosim documentation built on Oct. 18, 2024, 1:29 a.m.