Skip to content

Commit

Permalink
Create different families of functions for @family. #19
Browse files Browse the repository at this point in the history
  • Loading branch information
andrie committed Dec 12, 2014
1 parent d2dc2eb commit 0c4a7b2
Show file tree
Hide file tree
Showing 18 changed files with 62 additions and 73 deletions.
13 changes: 8 additions & 5 deletions R/addPackages.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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.
#'
Expand All @@ -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
#'
Expand Down Expand Up @@ -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
#'
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions R/getCranDescription.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)){

Expand Down
6 changes: 4 additions & 2 deletions R/makeDepGraph.R
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion R/makeRepo.R
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
8 changes: 4 additions & 4 deletions R/pkgDep.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"))

Expand All @@ -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

Expand Down Expand Up @@ -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])) {
Expand Down
4 changes: 2 additions & 2 deletions R/plot.pkgDepGraph.R
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
9 changes: 4 additions & 5 deletions R/updatePackages.R
Original file line number Diff line number Diff line change
Expand Up @@ -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}}.
#'
Expand All @@ -26,7 +26,7 @@
#' @family miniCRAN functions
#'
#' @export
#' @docType methods
#' @family update repo functions
#'
#' @example /inst/examples/example_updatePackages.R
#'
Expand Down Expand Up @@ -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"),
Expand Down
6 changes: 5 additions & 1 deletion man/addOldPackage.Rd
Original file line number Diff line number Diff line change
@@ -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.}
Expand Down Expand Up @@ -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}}
}

6 changes: 5 additions & 1 deletion man/addPackage.Rd
Original file line number Diff line number Diff line change
@@ -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.}
Expand Down Expand Up @@ -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}}
}

7 changes: 2 additions & 5 deletions man/basePkgs.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
}

8 changes: 6 additions & 2 deletions man/checkVersions.Rd
Original file line number Diff line number Diff line change
@@ -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.}
Expand All @@ -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
Expand Down Expand Up @@ -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}}
}

9 changes: 3 additions & 6 deletions man/makeDepGraph.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
}

8 changes: 3 additions & 5 deletions man/makeRepo.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
}

11 changes: 4 additions & 7 deletions man/oldPackages.Rd
Original file line number Diff line number Diff line change
@@ -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}
Expand All @@ -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}()}.}

Expand Down Expand Up @@ -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}}
}

6 changes: 0 additions & 6 deletions man/pkgAvail.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
}

10 changes: 3 additions & 7 deletions man/pkgDep.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
}

8 changes: 2 additions & 6 deletions man/plot.pkgDepGraph.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
}

12 changes: 4 additions & 8 deletions man/updatePackages.Rd
Original file line number Diff line number Diff line change
@@ -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}
Expand All @@ -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}}.}

Expand Down Expand Up @@ -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}}
}

0 comments on commit 0c4a7b2

Please sign in to comment.