[Xts-commits] r854 - in pkg/xtsExtra: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Sep 17 05:21:19 CEST 2014


Author: rossbennett34
Date: 2014-09-17 05:21:19 +0200 (Wed, 17 Sep 2014)
New Revision: 854

Added:
   pkg/xtsExtra/man/addLegend.Rd
   pkg/xtsExtra/man/addLines.Rd
   pkg/xtsExtra/man/addPoints.Rd
   pkg/xtsExtra/man/addSeries.Rd
Modified:
   pkg/xtsExtra/R/plot2.R
   pkg/xtsExtra/man/plot.xts.Rd
Log:
adding some documentation for add* functions

Modified: pkg/xtsExtra/R/plot2.R
===================================================================
--- pkg/xtsExtra/R/plot2.R	2014-09-17 00:32:32 UTC (rev 853)
+++ pkg/xtsExtra/R/plot2.R	2014-09-17 03:21:19 UTC (rev 854)
@@ -217,8 +217,7 @@
 #' @param legend.loc places a legend into one of nine locations on the chart: 
 #' bottomright, bottom, bottomleft, left, topleft, top, topright, right, or 
 #' center. Default NULL does not draw a legend. 
-#' 
-#' 
+#' @author Ross Bennett
 plot.xts <- function(x, 
                       y=NULL,
                       ...,
@@ -787,7 +786,18 @@
   plot_object
 }
 
-
+#' Add a time series to an existing xts plot
+#' 
+#' @param x an xts object to plot.
+#' @param main main title for a new panel if drawn.
+#' @param on panel number to draw on. A new panel will be drawn if \code{on=NA}.
+#' @param type the type of plot to be drawn, same as in \code{\link{plot}}.
+#' @param col color palette to use, set by default to rational choices.
+#' @param lty set the line type, same as in \code{\link{plot}}.
+#' @param lwd set the line width, same as in \code{\link{plot}}.
+#' @param pch the type of plot to be drawn, same as in \code{\link{plot}}.
+#' @param \dots any other passthrough parameters. Not currently used.
+#' @author Ross Bennett
 addSeries <- function(x, main="", on=NA, type="l", col=NULL, lty=1, lwd=1, pch=0, ...){
   lenv <- new.env()
   lenv$main <- main
@@ -895,11 +905,37 @@
   plot_object
 }
 
-addPoints <- function(x, main="", on=NA, pch=0, ...){
-  addSeries(x, main=main, on=on, type="p", pch=pch, ...)
+#' Add time series of points to an existing xts plot
+#' 
+#' @param x an xts object to plot.
+#' @param main main title for a new panel if drawn.
+#' @param on panel number to draw on. A new panel will be drawn if \code{on=NA}.
+#' @param col color palette to use, set by default to rational choices.
+#' @param pch the type of plot to be drawn, same as in \code{\link{plot}}.
+#' @param \dots any other passthrough parameters. Not currently used.
+#' @author Ross Bennett
+addPoints <- function(x, main="", on=NA, col=NULL, pch=0, ...){
+  addSeries(x, main=main, on=on, type="p", col=col, pch=pch, ...)
 }
 
-
+#' Add vertical lines to an existing xts plot
+#' 
+#' @param event.lines character vector of dates. Vertical lines will be drawn 
+#' to indicate that an event happened during that time period.  \code{event.lines} should
+#' be a vector of dates (e.g., \code{c("09/03","05/06"))} formatted the same as
+#' \code{date.format}. This function matches the re-formatted row names (dates) with
+#' the events.list, so to get a match the formatting needs to be correct.
+#' @param event.labels character vector of event labels corresponding to 
+#' \code{event.lines}. This will apply text labels (e.g., 
+#' \code{c("This Event", "That Event")} to the vertical lines drawn.
+#' @param date.format format for the dates in \code{event.lines}.
+#' @param main main title for a new panel if drawn.
+#' @param on panel number to draw on. A new panel will be drawn if \code{on=NA}.
+#' @param lty set the line type, same as in \code{\link{plot}}.
+#' @param lwd set the line width, same as in \code{\link{plot}}.
+#' @param col color palette to use, set by default to rational choices.
+#' @param \dots any other passthrough parameters. Not currently used.
+#' @author Ross Bennett
 addLines <- function(event.dates, event.labels=NULL, date.format="%Y-%m-%d", main="", on=NA, lty=1, lwd=1, col=1, ...){
   # add checks for event.dates and event.labels
   if(!is.null(event.labels))
@@ -1312,6 +1348,14 @@
   plot_object
 }
 
+#' Add Legend
+#' 
+#' @param legend.loc legend.loc places a legend into one of nine locations on 
+#' the chart: bottomright, bottom, bottomleft, left, topleft, top, topright, 
+#' right, or center.
+#' @param ncol number of columns for the legend
+#' @param \dots any other passthrough parameters. Not currently used.
+#' @author Ross Bennett
 addLegend <- function(legend.loc="center", ncol=1, ...){
   lenv <- new.env()
   lenv$main <- ""

Added: pkg/xtsExtra/man/addLegend.Rd
===================================================================
--- pkg/xtsExtra/man/addLegend.Rd	                        (rev 0)
+++ pkg/xtsExtra/man/addLegend.Rd	2014-09-17 03:21:19 UTC (rev 854)
@@ -0,0 +1,23 @@
+% Generated by roxygen2 (4.0.1): do not edit by hand
+\name{addLegend}
+\alias{addLegend}
+\title{Add Legend}
+\usage{
+addLegend(legend.loc = "center", ncol = 1, ...)
+}
+\arguments{
+\item{legend.loc}{legend.loc places a legend into one of nine locations on
+the chart: bottomright, bottom, bottomleft, left, topleft, top, topright,
+right, or center.}
+
+\item{ncol}{number of columns for the legend}
+
+\item{\dots}{any other passthrough parameters. Not currently used.}
+}
+\description{
+Add Legend
+}
+\author{
+Ross Bennett
+}
+

Added: pkg/xtsExtra/man/addLines.Rd
===================================================================
--- pkg/xtsExtra/man/addLines.Rd	                        (rev 0)
+++ pkg/xtsExtra/man/addLines.Rd	2014-09-17 03:21:19 UTC (rev 854)
@@ -0,0 +1,40 @@
+% Generated by roxygen2 (4.0.1): do not edit by hand
+\name{addLines}
+\alias{addLines}
+\title{Add vertical lines to an existing xts plot}
+\usage{
+addLines(event.dates, event.labels = NULL, date.format = "\%Y-\%m-\%d",
+  main = "", on = NA, lty = 1, lwd = 1, col = 1, ...)
+}
+\arguments{
+\item{event.lines}{character vector of dates. Vertical lines will be drawn
+to indicate that an event happened during that time period.  \code{event.lines} should
+be a vector of dates (e.g., \code{c("09/03","05/06"))} formatted the same as
+\code{date.format}. This function matches the re-formatted row names (dates) with
+the events.list, so to get a match the formatting needs to be correct.}
+
+\item{event.labels}{character vector of event labels corresponding to
+\code{event.lines}. This will apply text labels (e.g.,
+\code{c("This Event", "That Event")} to the vertical lines drawn.}
+
+\item{date.format}{format for the dates in \code{event.lines}.}
+
+\item{main}{main title for a new panel if drawn.}
+
+\item{on}{panel number to draw on. A new panel will be drawn if \code{on=NA}.}
+
+\item{lty}{set the line type, same as in \code{\link{plot}}.}
+
+\item{lwd}{set the line width, same as in \code{\link{plot}}.}
+
+\item{col}{color palette to use, set by default to rational choices.}
+
+\item{\dots}{any other passthrough parameters. Not currently used.}
+}
+\description{
+Add vertical lines to an existing xts plot
+}
+\author{
+Ross Bennett
+}
+

Added: pkg/xtsExtra/man/addPoints.Rd
===================================================================
--- pkg/xtsExtra/man/addPoints.Rd	                        (rev 0)
+++ pkg/xtsExtra/man/addPoints.Rd	2014-09-17 03:21:19 UTC (rev 854)
@@ -0,0 +1,27 @@
+% Generated by roxygen2 (4.0.1): do not edit by hand
+\name{addPoints}
+\alias{addPoints}
+\title{Add time series of points to an existing xts plot}
+\usage{
+addPoints(x, main = "", on = NA, col = NULL, pch = 0, ...)
+}
+\arguments{
+\item{x}{an xts object to plot.}
+
+\item{main}{main title for a new panel if drawn.}
+
+\item{on}{panel number to draw on. A new panel will be drawn if \code{on=NA}.}
+
+\item{col}{color palette to use, set by default to rational choices.}
+
+\item{pch}{the type of plot to be drawn, same as in \code{\link{plot}}.}
+
+\item{\dots}{any other passthrough parameters. Not currently used.}
+}
+\description{
+Add time series of points to an existing xts plot
+}
+\author{
+Ross Bennett
+}
+

Added: pkg/xtsExtra/man/addSeries.Rd
===================================================================
--- pkg/xtsExtra/man/addSeries.Rd	                        (rev 0)
+++ pkg/xtsExtra/man/addSeries.Rd	2014-09-17 03:21:19 UTC (rev 854)
@@ -0,0 +1,34 @@
+% Generated by roxygen2 (4.0.1): do not edit by hand
+\name{addSeries}
+\alias{addSeries}
+\title{Add a time series to an existing xts plot}
+\usage{
+addSeries(x, main = "", on = NA, type = "l", col = NULL, lty = 1,
+  lwd = 1, pch = 0, ...)
+}
+\arguments{
+\item{x}{an xts object to plot.}
+
+\item{main}{main title for a new panel if drawn.}
+
+\item{on}{panel number to draw on. A new panel will be drawn if \code{on=NA}.}
+
+\item{type}{the type of plot to be drawn, same as in \code{\link{plot}}.}
+
+\item{col}{color palette to use, set by default to rational choices.}
+
+\item{lty}{set the line type, same as in \code{\link{plot}}.}
+
+\item{lwd}{set the line width, same as in \code{\link{plot}}.}
+
+\item{pch}{the type of plot to be drawn, same as in \code{\link{plot}}.}
+
+\item{\dots}{any other passthrough parameters. Not currently used.}
+}
+\description{
+Add a time series to an existing xts plot
+}
+\author{
+Ross Bennett
+}
+

Modified: pkg/xtsExtra/man/plot.xts.Rd
===================================================================
--- pkg/xtsExtra/man/plot.xts.Rd	2014-09-17 00:32:32 UTC (rev 853)
+++ pkg/xtsExtra/man/plot.xts.Rd	2014-09-17 03:21:19 UTC (rev 854)
@@ -3,8 +3,8 @@
 \alias{plot.xts}
 \title{Time series Plotting}
 \usage{
-\method{plot}{xts}(x, y = NULL, ..., subset = "", FUN = NULL, panels = NULL,
-  multi.panel = FALSE, colorset = 1:12, up.col = "green",
+\method{plot}{xts}(x, y = NULL, ..., subset = "", FUN = NULL,
+  panels = NULL, multi.panel = FALSE, colorset = 1:12, up.col = "green",
   dn.col = "red", type = "l", lty = 1, lwd = 2, lend = 1,
   main = deparse(substitute(x)), clev = 0, cex = 0.6, cex.axis = 0.9,
   mar = c(3, 2, 0, 2), srt = 0, xaxis.las = 0, ylim = NULL,
@@ -94,4 +94,7 @@
 Plotting for xts objects.
 TODO: description, details, and examples
 }
+\author{
+Ross Bennett
+}
 



More information about the Xts-commits mailing list