From 16efb06d104c0a09a4173934ac579a0ba1377103 Mon Sep 17 00:00:00 2001 From: Detlef Groth Date: Wed, 6 Sep 2023 14:37:57 +0200 Subject: [PATCH] adding package help page --- Makefile | 3 +++ R/add.R | 25 ++++++++++++++++++++++++- man/Rpkg-package.Rd | 20 ++++++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 man/Rpkg-package.Rd diff --git a/Makefile b/Makefile index 232c36d..aa1892d 100644 --- a/Makefile +++ b/Makefile @@ -8,3 +8,6 @@ check: build man/%.Rd: R/%.R Rscript bin/rman.R $< + +install: check + R CMD INSTALL $(PKG)_$(VERSION).tar.gz diff --git a/R/add.R b/R/add.R index 354ea17..2556ea7 100644 --- a/R/add.R +++ b/R/add.R @@ -7,7 +7,30 @@ ## > source('bin/rman.R') ## > extractRd(list.files("R",pattern="*.R$",full.names=TRUE)) -## Function documentation, protect percent signs % with backslashes \% +## package-documentation +#' \name{Rpkg-package} +#' \alias{Rpkg-package} +#' \title{Rpkg package - package template for R packages} +#' \description{The Rpkg package can be used as a template to create new packages from scratch.} +#' \details{Some more details: +#' The following list of objects and/or functions are available: +#' \describe{ +#' \item{\link[Rpkg:add]{add(x,y)}}{an illustrative add function} +#' } +#' } +#' \examples{ +#' library(Rpkg) +#' add(1,2) +#' } +#' \author{Detlef Groth } +#' \references{ +#' \itemize{ +#' \item XYZ +#' } +#' } +"" + +## Functions documentation, protect percent signs % with backslashes \% #' \name{add} #' \alias{add} diff --git a/man/Rpkg-package.Rd b/man/Rpkg-package.Rd new file mode 100644 index 0000000..e7dbbfa --- /dev/null +++ b/man/Rpkg-package.Rd @@ -0,0 +1,20 @@ +\name{Rpkg-package} +\alias{Rpkg-package} +\title{Rpkg package - package template for R packages} +\description{The Rpkg package can be used as a template to create new packages from scratch.} +\details{Some more details: +The following list of objects and/or functions is available: +\describe{ +\item{\link[Rpkg:add]{add(x,y)}}{an illustrative add function} +} +} +\examples{ +library(Rpkg) +add(1,2) +} +\author{Detlef Groth } +\references{ +\itemize{ + \item XYZ +} +}