View source: R/archive.packages.R
archive.packages | R Documentation |
Use this function to move older versions of a package to a specified archive directory, or remove them completely.
archive.packages(
repo.root,
to.dir = "Archive",
keep = 1,
keep.revisions = 2,
package = NULL,
type = "source",
archive.root = repo.root,
overwrite = FALSE,
reallyDoIt = FALSE,
graceful = FALSE,
deb.options = list(distribution = "unstable", component = "main", gpg.version = 2,
gpg.key = NULL, keyring = NULL, deb.dir = "deb")
)
repo.root |
Path to the repository root, i.e.,
the directory which contains the |
to.dir |
Character string, name of the folder to move the old packages to. |
keep |
An integer value defining the maximum nuber of versions to keep. Setting this to 0 will
completely remove all packages from the repository,
which is probably only useful in combination
with the option |
keep.revisions |
An integer value defining the maximum nuber of revisions to keep. This is only
used when archiving Debian packages, i.e.,
if |
package |
A character vector with package names to check. If set,
|
type |
A character vector defining the package formats to keep. Valid entries are |
archive.root |
Path to the archive root, i.e.,
the directory to which files should be moved. Usually
the Archive is kept in |
overwrite |
Logical, indicates whether existing files in the archive can be overwritten. |
reallyDoIt |
Logical, real actions are only taken if set to |
graceful |
Logical,
if |
deb.options |
A named list of options that must be properly set if you want to archive Debian packages. After packages were
removed from the repo, all Packages,
Sources and Release files must be re-written and signed, and all of the following
information is required: |
This function responds to sandbox
.
sandbox
to run archive.packages() in a sandbox.
## Not run:
# dry run, only prints what would happen, so you can check
# if that's really what you want
archive.packages("file:///var/www/repo")
# after we've confirmed that the right packages will be moved
# and deleted, let's actually commit the changes
archive.packages("file:///var/www/repo", reallyDoIt=TRUE)
# if we don't want a standard archive, but for instance a parallel
# archive repository, we can have it. let's move all but the latest two
# versions from /var/www/repo to /var/www/archive. to suppress the
# creation of a special archive directory, we set to.dir=""
archive.packages("file:///var/www/repo", to.dir="", keep=2,
type=c("source", "win.binary", "mac.binary"),
archive.root="/var/www/archive", reallyDoIt=TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.