R: Add local packages to a miniCRAN repository.

addLocalPackage {miniCRAN} | R Documentation

## Add local packages to a miniCRAN repository.

### Description

Examine the contents of a directory specified by `pkgPath` for pre-built packages matching the names specified by `pkgs`, and add these to the miniCRAN repository.

### Usage

    addLocalPackage(pkgs = NULL, pkgPath = NULL, path = NULL,
      type = "source", Rversion = R.version, writePACKAGES = TRUE,
      deps = FALSE, quiet = FALSE, build = FALSE)

### Arguments

`pkgs` | Character vector of packages to download
`pkgPath` | Character vector of directory location containing packages to be added. Note that `pkgPath` should be the parent directory of the package (i.e., the package directory path is constructed from `file.path(pkgPath, pkgs)`).
`path` | Destination download path. This path is the root folder of your new repository.
`type` | Possible values are (currently) "source", "mac.binary" and "win.binary": the binary types can be listed and downloaded but not installed on other platforms. Passed to `download.packages()`.
`Rversion` | Version of R. Can be specified as a character string with the two digit R version, e.g. "3.1". Defaults to R.version
`writePACKAGES` | If TRUE, calls `write_PACKAGES()` to update the repository PACKAGES file.
`deps` | logical indicating whether the package dependencies should be added (default `TRUE`).
`quiet` | If TRUE, suppress status messages (if any), and the progress bar during download.
`build` | Logical indicating whether packages should be build prior to adding.

### Details

To build a package from source and then add it, use `build = TRUE`. Note that package development libraries and the `devtools` package must be installed on your system in order to build packages.

### Value

Installs the packages and returns the new package index.

### Note

Currently, adding local packages does not check nor download their dependencies.

### Author(s)

Alex Chubaty

### Examples

    ## Not run:
     addLocalPackage("myPackage", "path/to/my/prebuilt/package",
                     "path/to/my/miniCRAN/repo")

     addLocalPackage("myPackage", "path/to/my/package/sourcecode",
                     "path/to/my/miniCRAN/repo", build = TRUE)

    ## End(Not run)

[Package miniCRAN version 0.2.10 Index]