[rkward-cvs] SF.net SVN: rkward:[4341] trunk/rkward
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Mon Oct 1 10:21:27 UTC 2012
Revision: 4341
http://rkward.svn.sourceforge.net/rkward/?rev=4341&view=rev
Author: tfry
Date: 2012-10-01 10:21:26 +0000 (Mon, 01 Oct 2012)
Log Message:
-----------
Convert documentation for rk.graph.on and rk.graph.off to roxygen format.
The plot history functions are the only non-roxygenized functions left, now.
Modified Paths:
--------------
trunk/rkward/rkward/rbackend/rpackages/rkward/R/public_graphics.R
trunk/rkward/rkward/rbackend/rpackages/rkward/man/rk.graph.on.Rd
trunk/rkward/scripts/roxygenize.sh
Modified: trunk/rkward/rkward/rbackend/rpackages/rkward/R/public_graphics.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkward/R/public_graphics.R 2012-10-01 09:27:02 UTC (rev 4340)
+++ trunk/rkward/rkward/rbackend/rpackages/rkward/R/public_graphics.R 2012-10-01 10:21:26 UTC (rev 4341)
@@ -1,8 +1,48 @@
## Public functions manipulating "graphics" should be stored here.
## These functions are accessible to the user.
-# Requests a graph to be written.
+#' Plot graphics to HTML output file
+#'
+#' \code{rk.graph.on()} creates an R device that will plot to the output html page in RKWard (\url{rkward://page/rkward_output}).
+#' The default settings for \code{device.type}, \code{width}, \code{height}, and \code{quality} can be modified from Settings -> Configure RKWard -> Output.
+#'
+#' @param device.type Type of device to create / graphics format to use. Currently, supported devices are "PNG", "SVG", or "JPG".
+#' The default is to use the format configured in Settings -> Configure RKWard -> Output.
+#' @param width Width of graphics in pixels. The default is to use the width configured in Settings -> Configure RKWard -> Output.
+#' @param height Height of graphics in pixels. The default is to use the heigth configured in Settings -> Configure RKWard -> Output.
+#' @param quality For device.type "JPG", quality of the JPG file from 0 to 100.
+#' The default is to use the quality configured in Settings -> Configure RKWard -> Output.
+#' @param ... Further options will be passed to the graphics device used internally.
+#'
+#' \bold{Warning}: It is advised to use \code{rk.graph.off} and \bold{not} \code{dev.off} to close the device opened by
+#' \code{rk.graph.on}. \code{dev.print(device = rk.graph.on)} is a \bold{wrong} usage for this "device," and will result in errors.
+#'
+#' @author Thomas Friedrichsmeier \email{rkward-devel@@lists.sourceforge.net}
+#'
+#' @seealso \link{rk.results} \link{rk.print} \link{rk.get.output.html.file} \link{dev.off} \link{svg} \link{png} \link{jpg}
+#'
+#' @examples
+#' require (rkward)
+#'
+#' ## Plot directly to the output (html) file, by-passing screen device:
+#' rk.graph.on ("JPG", 480, 480, 75)
+#' plot (rnorm (100))
+#' rk.graph.off ()
+#'
+#' ## Copy the displayed plot to the output:
+#' plot (rnorm (100))
+#' dev.copy (device = rk.graph.on)
+#' rk.graph.off ()
+#'
+#' ## WRONG USAGE: not run:
+#' #plot (rnorm (100))
+#' #dev.print (device = rk.graph.on)
+#'
+#' @keywords devices
+#'
#' @export
+#' @aliases rk.graph.on rk.graph.off
+#' @rdname rk.graph.on
rk.graph.on <- function (device.type=getOption ("rk.graphics.type"), width=getOption ("rk.graphics.width"), height=getOption ("rk.graphics.height"), quality, ...)
{
if (!is.numeric (width)) width <- 480
@@ -45,6 +85,9 @@
invisible (ret)
}
+#' \code{rk.graph.off()} closes the device that was opened by \code{rk.graph.on}.
+#'
+#' @rdname rk.graph.on
#' @export
"rk.graph.off" <- function(){
.rk.cat.output ("\n") # so the output will be auto-refreshed
Modified: trunk/rkward/rkward/rbackend/rpackages/rkward/man/rk.graph.on.Rd
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkward/man/rk.graph.on.Rd 2012-10-01 09:27:02 UTC (rev 4340)
+++ trunk/rkward/rkward/rbackend/rpackages/rkward/man/rk.graph.on.Rd 2012-10-01 10:21:26 UTC (rev 4341)
@@ -1,46 +1,52 @@
\name{rk.graph.on}
+\alias{rk.graph.off}
\alias{rk.graph.on}
-\alias{rk.graph.off}
-
-\title{Copy device to HTML output}
-
-\description{
- Create or copy a device to a html page which is displayed as "output" in RKWard; accessible from Windows->Show Output. \code{rk.graph.off} closes the device that was opened by \code{rk.graph.on}. The default settings for \code{device.type}, \code{width}, \code{height}, and \code{quality} can be modified from Settings -> Configure RKWard -> Output.
-}
-
+\title{Plot graphics to HTML output file}
\usage{
-rk.graph.on(device.type = getOption("rk.graphics.type"),
- width = getOption("rk.graphics.width"), height = getOption("rk.graphics.height"),
- quality, ...)
+ rk.graph.on(device.type = getOption("rk.graphics.type"),
+ width = getOption("rk.graphics.width"),
+ height = getOption("rk.graphics.height"), quality, ...)
-rk.graph.off()
+ rk.graph.off()
}
\arguments{
- \item{device.type}{a string, either \code{"PNG"} or \code{"JPG"} or \code{"SVG"} or \code{NULL}. In case of \code{NULL}, the default, \code{"PNG"}, is used.}
- \item{width,height}{in pixels, the width and height of the copied device; default is 480 for both.}
- \item{quality, \dots}{other arguments passed to the device function}
-}
+ \item{device.type}{Type of device to create / graphics
+ format to use. Currently, supported devices are "PNG",
+ "SVG", or "JPG". The default is to use the format
+ configured in Settings -> Configure RKWard -> Output.}
-\value{
- \code{rk.graph.on} invisibly returns the value of the corresponding device call, which, generally, is nothing.
-
- \code{rk.graph.off} returns the number and name of the device that was active before \code{rk.graph.on} was called, whenever possbile. When not possible it returns the number and name of the next active device as done by \code{\link{dev.off}}.
-}
+ \item{width}{Width of graphics in pixels. The default is
+ to use the width configured in Settings -> Configure
+ RKWard -> Output.}
-\author{Thomas Friedrichsmeier \email{rkward-devel at lists.sourceforge.net}}
+ \item{height}{Height of graphics in pixels. The default
+ is to use the heigth configured in Settings -> Configure
+ RKWard -> Output.}
-\section{Warning}{
- \itemize{
- \item It is advised to use \code{rk.graph.off} and \bold{not} \code{dev.off} to close the device opened by \code{rk.graph.on}.
-
- \item \code{dev.print(device = rk.graph.on)} is a \bold{wrong} usage for this "device," and will result in errors.
- }
+ \item{quality}{For device.type "JPG", quality of the JPG
+ file from 0 to 100. The default is to use the quality
+ configured in Settings -> Configure RKWard -> Output.}
+
+ \item{...}{Further options will be passed to the graphics
+ device used internally.
+
+ \bold{Warning}: It is advised to use \code{rk.graph.off}
+ and \bold{not} \code{dev.off} to close the device opened
+ by \code{rk.graph.on}. \code{dev.print(device =
+ rk.graph.on)} is a \bold{wrong} usage for this "device,"
+ and will result in errors.}
}
+\description{
+ \code{rk.graph.on()} creates an R device that will plot
+ to the output html page in RKWard
+ (\url{rkward://page/rkward_output}). The default settings
+ for \code{device.type}, \code{width}, \code{height}, and
+ \code{quality} can be modified from Settings -> Configure
+ RKWard -> Output.
-\seealso{
- \code{\link{png}}, \code{\link{svg}}, \code{\link{dev.copy}}, \code{\link{dev.off}}, \url{rkward://page/rkward_output}
+ \code{rk.graph.off()} closes the device that was opened
+ by \code{rk.graph.on}.
}
-
\examples{
require (rkward)
@@ -58,5 +64,14 @@
#plot (rnorm (100))
#dev.print (device = rk.graph.on)
}
+\author{
+ Thomas Friedrichsmeier
+ \email{rkward-devel at lists.sourceforge.net}
+}
+\seealso{
+ \link{rk.results} \link{rk.print}
+ \link{rk.get.output.html.file} \link{dev.off} \link{svg}
+ \link{png} \link{jpg}
+}
+\keyword{devices}
-\keyword{device}
Modified: trunk/rkward/scripts/roxygenize.sh
===================================================================
--- trunk/rkward/scripts/roxygenize.sh 2012-10-01 09:27:02 UTC (rev 4340)
+++ trunk/rkward/scripts/roxygenize.sh 2012-10-01 10:21:26 UTC (rev 4341)
@@ -5,7 +5,7 @@
echo "
library (roxygen2)
- packages <- c ( # '${BASEDIR}/rkward/rbackend/rpackages/rkward/', # currently excluded due to incomplete conversion to roxygen documentation
+ packages <- c ( '${BASEDIR}/rkward/rbackend/rpackages/rkward/',
# '${BASEDIR}/rkward/rbackend/rpackages/rkwardtests/', # currently excluded due to missing support for slots in roxygen2
'${BASEDIR}/rkward/rbackend/rpackages/rkwarddev/',
'${BASEDIR}/rkward/rbackend/rpackages/XiMpLe/')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the rkward-tracker
mailing list