From 0c4a7b2d991f529facacd96dc68941b8f623eb11 Mon Sep 17 00:00:00 2001 From: Andrie de Vries Date: Fri, 12 Dec 2014 12:57:10 +0000 Subject: [PATCH] Create different families of functions for @family. #19 --- R/addPackages.R | 13 ++++++++----- R/getCranDescription.R | 1 + R/makeDepGraph.R | 6 ++++-- R/makeRepo.R | 3 ++- R/pkgDep.R | 8 ++++---- R/plot.pkgDepGraph.R | 4 ++-- R/updatePackages.R | 9 ++++----- man/addOldPackage.Rd | 6 +++++- man/addPackage.Rd | 6 +++++- man/basePkgs.Rd | 7 ++----- man/checkVersions.Rd | 8 ++++++-- man/makeDepGraph.Rd | 9 +++------ man/makeRepo.Rd | 8 +++----- man/oldPackages.Rd | 11 ++++------- man/pkgAvail.Rd | 6 ------ man/pkgDep.Rd | 10 +++------- man/plot.pkgDepGraph.Rd | 8 ++------ man/updatePackages.Rd | 12 ++++-------- 18 files changed, 62 insertions(+), 73 deletions(-) diff --git a/R/addPackages.R b/R/addPackages.R index 0d7b60f..174eb71 100644 --- a/R/addPackages.R +++ b/R/addPackages.R @@ -88,7 +88,10 @@ readDescriptionGithub <- function(repo, username, branch="master", quiet=TRUE){ #' @param repo Character vector. Name of repository on github, e.g. \code{"RevolutionAnalytics/checkpoint"} #' @param username Optional character vector. Name of repository on github, e.g. \code{"RevolutionAnalytics/checkpoint"} #' @param branch name of branch, defaults to \code{"master"} + #' @export +#' @family github functions +#' #' @example /inst/examples/example_addPackage.R addPackageListingGithub <- function(pdb=pkgAvail(), repo, username=NULL, branch="master"){ desc <- readDescriptionGithub(repo=repo, username=username, branch=branch) @@ -102,7 +105,7 @@ addPackageListingGithub <- function(pdb=pkgAvail(), repo, username=NULL, branch= #' Check for previous versions of packages in a miniCRAN repository. #' -#' Checks for previous versions, and returns the file paths for packages with multiple versions. The admin can subsequently decide which version to keep. +#' Checks for previous versions, and returns the file paths for packages with multiple versions. You can subsequently decide which version to keep. #' #' @param pkgs Character vector of packages to be installed. If not provided, checks all files for multiple package versions. #' @@ -115,7 +118,7 @@ addPackageListingGithub <- function(pdb=pkgAvail(), repo, username=NULL, branch= #' @return Returns invisibly the filepaths to packages with multiple versions for removal. #' #' @export -#' @docType methods +#' @family update repo functions #' #' @example /inst/examples/example_checkVersions.R #' @@ -169,7 +172,7 @@ checkVersions <- function(pkgs=NULL, path=NULL, type="source", #' #' @importFrom tools write_PACKAGES #' @export -#' @docType methods +#' @family update repo functions #' #' @example /inst/examples/example_checkVersions.R #' @@ -213,8 +216,8 @@ addPackage <- function(pkgs=NULL, path=NULL, repos=getOption("repos"), #' #' @importFrom tools write_PACKAGES #' @export -#' @docType methods -#' +#' @family update repo functions +#' #' @example /inst/examples/example_checkVersions.R #' addOldPackage <- function(pkgs=NULL, path=NULL, vers=NULL, diff --git a/R/getCranDescription.R b/R/getCranDescription.R index a9045ca..109c271 100644 --- a/R/getCranDescription.R +++ b/R/getCranDescription.R @@ -4,6 +4,7 @@ #' @inheritParams makeRepo #' @import XML #' @export +#' #' @example /inst/examples/example_getCranDescription.R getCranDescription <- function(pkg, repos=getOption("repos"), type="source", path, pkgs = pkgDep(pkg, repos=repos, type=type)){ diff --git a/R/makeDepGraph.R b/R/makeDepGraph.R index 59f255c..1990f3d 100644 --- a/R/makeDepGraph.R +++ b/R/makeDepGraph.R @@ -35,8 +35,10 @@ addDepType <- function(p, type = c("Imports", "Depends", "LinkingTo", "Suggests" #' #' @import igraph #' @export -#' @family miniCRAN functions -#' @seealso \code{\link{pkgDep}}, \code{\link{plot.pkgDepGraph}} +#' @family dependency functions +#' +#' @seealso \code{\link{pkgDep}} to extract package dependencies +#' #' @example /inst/examples/example_makeDepGraph.R makeDepGraph <- function( pkg, availPkgs, repos=getOption("repos"), type="source", diff --git a/R/makeRepo.R b/R/makeRepo.R index ee6f2de..e435537 100644 --- a/R/makeRepo.R +++ b/R/makeRepo.R @@ -44,7 +44,8 @@ #' @param writePACKAGES If TRUE, calls \code{\link{write_PACKAGES}} to update the repository PACKAGES file. #' #' @export -#' @family miniCRAN functions +#' @family update repo functions +#' #' @example /inst/examples/example_makeRepo.R makeRepo <- function(pkgs, path, repos=getOption("repos"), type="source", Rversion=R.version, download=TRUE, writePACKAGES=TRUE) { diff --git a/R/pkgDep.R b/R/pkgDep.R index 5e30d83..2fd01f0 100644 --- a/R/pkgDep.R +++ b/R/pkgDep.R @@ -3,7 +3,8 @@ #' Retrieves names of installed packages by calling \code{\link[utils]{installed.packages}} and returning only those packages where \code{Priority} equals "base". #' #' @export -#' @family miniCRAN functions +#' @family dependency functions +#' #' @seealso \code{\link{pkgDep}} basePkgs <- function()names(which(installed.packages()[, "Priority"] == "base")) @@ -25,8 +26,7 @@ basePkgs <- function()names(which(installed.packages()[, "Priority"] == "base")) #' @param ... Other arguments passed to \code{\link{available.packages}} #' #' @export -#' @seealso \code{\link{makeDepGraph}} -#' @family miniCRAN functions +#' @family dependency functions #' #' @example /inst/examples/example_pkgDep.R @@ -118,7 +118,7 @@ print.pkgDep <- function(x, ...){ #' #' @inheritParams pkgDep #' @export -#' @family miniCRAN functions +#' @family create repo functions #' @seealso \code{\link{pkgDep}} pkgAvail <- function(repos=getOption("repos"), type="source", ...){ if(!grepl("^file", repos[1]) && file.exists(repos[1])) { diff --git a/R/plot.pkgDepGraph.R b/R/plot.pkgDepGraph.R index e9d2846..33cc773 100644 --- a/R/plot.pkgDepGraph.R +++ b/R/plot.pkgDepGraph.R @@ -12,8 +12,8 @@ #' #' @import igraph #' -#' @family miniCRAN functions -#' @seealso \code{\link{makeDepGraph}} +#' @family dependency functions +#' #' @example /inst/examples/example_plot.pkgDepGraph.R #' plot.pkgDepGraph <- function( diff --git a/R/updatePackages.R b/R/updatePackages.R index 0b44791..9c6edb5 100644 --- a/R/updatePackages.R +++ b/R/updatePackages.R @@ -8,7 +8,7 @@ #' #' @param repos character vector, the base URL(s) of the repositories to use, e.g. the URL of a CRAN mirror such as "\code{http://cran.us.r-project.org}". #' -#' @param contriburl URL(s) of the contrib sections of the repositories. Use this argument if your repository is incomplete. Overrides argument repos. +#' @param contriburl URL(s) of the contrib sections of the repositories. Use this argument if your repository is incomplete. Overrides argument \code{repos}. #' #' @param method Download method, see \code{\link{download.file}}. #' @@ -26,7 +26,7 @@ #' @family miniCRAN functions #' #' @export -#' @docType methods +#' @family update repo functions #' #' @example /inst/examples/example_updatePackages.R #' @@ -95,10 +95,9 @@ oldPackages <- function (path=NULL, repos=getOption("repos"), #' #' @return \code{NULL} invisibly. #' -#' @seealso \code{\link{oldPackages}} -#' @family miniCRAN functions -#' @docType methods #' @export +#' @family update repo functions +#' #' @example /inst/examples/example_updatePackages.R #' updatePackages <- function (path=NULL, repos=getOption("repos"), diff --git a/man/addOldPackage.Rd b/man/addOldPackage.Rd index 1ca9f28..18bba92 100644 --- a/man/addOldPackage.Rd +++ b/man/addOldPackage.Rd @@ -1,5 +1,4 @@ % Generated by roxygen2 (4.0.2): do not edit by hand -\docType{methods} \name{addOldPackage} \alias{addOldPackage} \title{Add old package versions to a miniCRAN repository.} @@ -91,4 +90,9 @@ pkgList unlink(pth, recursive=TRUE) } } +\seealso{ +Other update repo functions: \code{\link{addPackage}}; + \code{\link{checkVersions}}; \code{\link{makeRepo}}; + \code{\link{oldPackages}}; \code{\link{updatePackages}} +} diff --git a/man/addPackage.Rd b/man/addPackage.Rd index 0c97d41..46f7d2b 100644 --- a/man/addPackage.Rd +++ b/man/addPackage.Rd @@ -1,5 +1,4 @@ % Generated by roxygen2 (4.0.2): do not edit by hand -\docType{methods} \name{addPackage} \alias{addPackage} \title{Add packages to a miniCRAN repository.} @@ -87,4 +86,9 @@ pkgList unlink(pth, recursive=TRUE) } } +\seealso{ +Other update repo functions: \code{\link{addOldPackage}}; + \code{\link{checkVersions}}; \code{\link{makeRepo}}; + \code{\link{oldPackages}}; \code{\link{updatePackages}} +} diff --git a/man/basePkgs.Rd b/man/basePkgs.Rd index c94d08d..64a8831 100644 --- a/man/basePkgs.Rd +++ b/man/basePkgs.Rd @@ -11,10 +11,7 @@ Retrieves names of installed packages by calling \code{\link[utils]{installed.pa \seealso{ \code{\link{pkgDep}} -Other miniCRAN.functions: \code{\link{makeDepGraph}}; - \code{\link{makeRepo}}; \code{\link{oldPackages}}; - \code{\link{pkgAvail}}; \code{\link{pkgDep}}; - \code{\link{plot.pkgDepGraph}}; - \code{\link{updatePackages}} +Other dependency functions: \code{\link{makeDepGraph}}; + \code{\link{pkgDep}}; \code{\link{plot.pkgDepGraph}} } diff --git a/man/checkVersions.Rd b/man/checkVersions.Rd index 357906e..49ae0d5 100644 --- a/man/checkVersions.Rd +++ b/man/checkVersions.Rd @@ -1,5 +1,4 @@ % Generated by roxygen2 (4.0.2): do not edit by hand -\docType{methods} \name{checkVersions} \alias{checkVersions} \title{Check for previous versions of packages in a miniCRAN repository.} @@ -20,7 +19,7 @@ checkVersions(pkgs = NULL, path = NULL, type = "source", Returns invisibly the filepaths to packages with multiple versions for removal. } \description{ -Checks for previous versions, and returns the file paths for packages with multiple versions. The admin can subsequently decide which version to keep. +Checks for previous versions, and returns the file paths for packages with multiple versions. You can subsequently decide which version to keep. } \examples{ ### `checkVersions` and `add.packages.miniCRAN` require an existing miniCRAN repo @@ -74,4 +73,9 @@ pkgList unlink(pth, recursive=TRUE) } } +\seealso{ +Other update repo functions: \code{\link{addOldPackage}}; + \code{\link{addPackage}}; \code{\link{makeRepo}}; + \code{\link{oldPackages}}; \code{\link{updatePackages}} +} diff --git a/man/makeDepGraph.Rd b/man/makeDepGraph.Rd index da858f9..4bd2b60 100644 --- a/man/makeDepGraph.Rd +++ b/man/makeDepGraph.Rd @@ -62,12 +62,9 @@ if(require(igraph)) plot(p) } } \seealso{ -\code{\link{pkgDep}}, \code{\link{plot.pkgDepGraph}} +\code{\link{pkgDep}} to extract package dependencies -Other miniCRAN.functions: \code{\link{basePkgs}}; - \code{\link{makeRepo}}; \code{\link{oldPackages}}; - \code{\link{pkgAvail}}; \code{\link{pkgDep}}; - \code{\link{plot.pkgDepGraph}}; - \code{\link{updatePackages}} +Other dependency functions: \code{\link{basePkgs}}; + \code{\link{pkgDep}}; \code{\link{plot.pkgDepGraph}} } diff --git a/man/makeRepo.Rd b/man/makeRepo.Rd index dfb6ee7..c43d9d8 100644 --- a/man/makeRepo.Rd +++ b/man/makeRepo.Rd @@ -100,10 +100,8 @@ unlink(pth, recursive = TRUE) } } \seealso{ -Other miniCRAN.functions: \code{\link{basePkgs}}; - \code{\link{makeDepGraph}}; \code{\link{oldPackages}}; - \code{\link{pkgAvail}}; \code{\link{pkgDep}}; - \code{\link{plot.pkgDepGraph}}; - \code{\link{updatePackages}} +Other update repo functions: \code{\link{addOldPackage}}; + \code{\link{addPackage}}; \code{\link{checkVersions}}; + \code{\link{oldPackages}}; \code{\link{updatePackages}} } diff --git a/man/oldPackages.Rd b/man/oldPackages.Rd index 02e29a7..238ad5d 100644 --- a/man/oldPackages.Rd +++ b/man/oldPackages.Rd @@ -1,5 +1,4 @@ % Generated by roxygen2 (4.0.2): do not edit by hand -\docType{methods} \name{oldPackages} \alias{oldPackages} \title{Compare miniCRAN Packages with CRAN-like Repositories} @@ -14,7 +13,7 @@ oldPackages(path = NULL, repos = getOption("repos"), \item{repos}{character vector, the base URL(s) of the repositories to use, e.g. the URL of a CRAN mirror such as "\code{http://cran.us.r-project.org}".} -\item{contriburl}{URL(s) of the contrib sections of the repositories. Use this argument if your repository is incomplete. Overrides argument repos.} +\item{contriburl}{URL(s) of the contrib sections of the repositories. Use this argument if your repository is incomplete. Overrides argument \code{repos}.} \item{availPkgs}{by default all packages hosted in the miniCRAN repo, \code{\link{pkgAvail}(repos=path, type=type)}. A subset can be specified; currently this must be in the same (character matrix) format as returned by \code{\link{pkgAvail}()}.} @@ -81,10 +80,8 @@ pkgList \seealso{ \code{\link{updatePackages}}, \code{\link{pkgAvail}}. -Other miniCRAN.functions: \code{\link{basePkgs}}; - \code{\link{makeDepGraph}}; \code{\link{makeRepo}}; - \code{\link{pkgAvail}}; \code{\link{pkgDep}}; - \code{\link{plot.pkgDepGraph}}; - \code{\link{updatePackages}} +Other update repo functions: \code{\link{addOldPackage}}; + \code{\link{addPackage}}; \code{\link{checkVersions}}; + \code{\link{makeRepo}}; \code{\link{updatePackages}} } diff --git a/man/pkgAvail.Rd b/man/pkgAvail.Rd index 53d4c32..209dff2 100644 --- a/man/pkgAvail.Rd +++ b/man/pkgAvail.Rd @@ -17,11 +17,5 @@ This is a thin wrapper around \code{\link[utils]{available.packages}}. If the a } \seealso{ \code{\link{pkgDep}} - -Other miniCRAN.functions: \code{\link{basePkgs}}; - \code{\link{makeDepGraph}}; \code{\link{makeRepo}}; - \code{\link{oldPackages}}; \code{\link{pkgDep}}; - \code{\link{plot.pkgDepGraph}}; - \code{\link{updatePackages}} } diff --git a/man/pkgDep.Rd b/man/pkgDep.Rd index be93136..d7a5433 100644 --- a/man/pkgDep.Rd +++ b/man/pkgDep.Rd @@ -46,12 +46,8 @@ pkgDep(pkg=c("ggplot2", "plyr", "reshape2"), pdb) } \seealso{ -\code{\link{makeDepGraph}} - -Other miniCRAN.functions: \code{\link{basePkgs}}; - \code{\link{makeDepGraph}}; \code{\link{makeRepo}}; - \code{\link{oldPackages}}; \code{\link{pkgAvail}}; - \code{\link{plot.pkgDepGraph}}; - \code{\link{updatePackages}} +Other dependency functions: \code{\link{basePkgs}}; + \code{\link{makeDepGraph}}; + \code{\link{plot.pkgDepGraph}} } diff --git a/man/plot.pkgDepGraph.Rd b/man/plot.pkgDepGraph.Rd index 6ad6966..c284e2e 100644 --- a/man/plot.pkgDepGraph.Rd +++ b/man/plot.pkgDepGraph.Rd @@ -60,11 +60,7 @@ plot(dg, legendPosition=c(1, 1), vertex.size=20, cex=0.5) } \seealso{ -\code{\link{makeDepGraph}} - -Other miniCRAN.functions: \code{\link{basePkgs}}; - \code{\link{makeDepGraph}}; \code{\link{makeRepo}}; - \code{\link{oldPackages}}; \code{\link{pkgAvail}}; - \code{\link{pkgDep}}; \code{\link{updatePackages}} +Other dependency functions: \code{\link{basePkgs}}; + \code{\link{makeDepGraph}}; \code{\link{pkgDep}} } diff --git a/man/updatePackages.Rd b/man/updatePackages.Rd index 50e2794..76b7940 100644 --- a/man/updatePackages.Rd +++ b/man/updatePackages.Rd @@ -1,5 +1,4 @@ % Generated by roxygen2 (4.0.2): do not edit by hand -\docType{methods} \name{updatePackages} \alias{updatePackages} \title{Compare miniCRAN Packages with CRAN-like Repositories} @@ -14,7 +13,7 @@ updatePackages(path = NULL, repos = getOption("repos"), \item{repos}{character vector, the base URL(s) of the repositories to use, e.g. the URL of a CRAN mirror such as "\code{http://cran.us.r-project.org}".} -\item{contriburl}{URL(s) of the contrib sections of the repositories. Use this argument if your repository is incomplete. Overrides argument repos.} +\item{contriburl}{URL(s) of the contrib sections of the repositories. Use this argument if your repository is incomplete. Overrides argument \code{repos}.} \item{method}{Download method, see \code{\link{download.file}}.} @@ -81,11 +80,8 @@ pkgList } } \seealso{ -\code{\link{oldPackages}} - -Other miniCRAN.functions: \code{\link{basePkgs}}; - \code{\link{makeDepGraph}}; \code{\link{makeRepo}}; - \code{\link{oldPackages}}; \code{\link{pkgAvail}}; - \code{\link{pkgDep}}; \code{\link{plot.pkgDepGraph}} +Other update repo functions: \code{\link{addOldPackage}}; + \code{\link{addPackage}}; \code{\link{checkVersions}}; + \code{\link{makeRepo}}; \code{\link{oldPackages}} }