- A mechanism for extending the basic functionality of R
- A collection of R functions, or other (data) objects
- Organized in a systematic fashion to provide a minimal amount of consistency
- Written by users/developers everywhere
Primarily available from CRAN and Bioconductor
Also available from GitHub, Bitbucket, Gitorious, etc. (and elsewhere)
Packages from CRAN/Bioconductor can be installed with install.packages()
Packages from GitHub can be installed using install_github()
from the devtools package
You do not have to put a package on a central repository, but doing so makes it easier for others to install your package.
These fields are optional but commonly used
gpclib
Package: gpclib
Title: General Polygon Clipping Library for R
Description: General polygon clipping routines for R based on Alan Murta's C library.
Version: 1.5-5
Author: Roger D. Peng rpeng@jhsph.edu with contributions from Duncan Murdoch and Barry Rowlingson; GPC library by Alan Murta
Maintainer: Roger D. Peng rpeng@jhsph.edu
License: file LICENSE
Depends: R (>= 2.14.0), methods
Imports: graphics
Date: 2013-04-01
URL: http://www.cs.man.ac.uk/~toby/gpc/, http://github.com/rdpeng/gpclib
Key directives
Also important
mvtsplot
packageexport("mvtsplot") import(splines) import(RColorBrewer) importFrom("grDevices", "colorRampPalette", "gray") importFrom("graphics", "abline", "axis", "box", "image", "layout", "lines", "par", "plot", "points", "segments", "strwidth", "text", "Axis") importFrom("stats", "complete.cases", "lm", "na.exclude", "predict", "quantile")
gpclib
packageexport("read.polyfile", "write.polyfile") importFrom(graphics, plot) exportClasses("gpc.poly", "gpc.poly.nohole") exportMethods("show", "get.bbox", "plot", "intersect", "union", "setdiff", "[", "append.poly", "scale.poly", "area.poly", "get.pts", "coerce", "tristrip", "triangulate")
line
Function\name{line} \alias{line} \alias{residuals.tukeyline} \title{Robust Line Fitting} \description{ Fit a line robustly as recommended in \emph{Exploratory Data Analysis}. }
line
Function\usage{ line(x, y) } \arguments{ \item{x, y}{the arguments can be any way of specifying x-y pairs. See \code{\link{xy.coords}}.} }
line
Function\details{ Cases with missing values are omitted. Long vectors are not supported. } \value{ An object of class \code{"tukeyline"}. Methods are available for the generic functions \code{coef}, \code{residuals}, \code{fitted}, and \code{print}. }
line
Function\references{ Tukey, J. W. (1977). \emph{Exploratory Data Analysis}, Reading Massachusetts: Addison-Wesley. }
R CMD build is a command-line program that creates a package archive file (.tar.gz
)
R CMD check runs a battery of tests on the package
You can run R CMD build or R CMD check from the command-line using a terminal or command-shell application
You can also run them from R using the system() function
system("R CMD build newpackage") system("R CMD check newpackage")
package.skeleton()
function in the utils package creates a "skeleton" R package