Skip to content

Commit

Permalink
roxygenize
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Jan 30, 2017
1 parent 8767ef1 commit f8e8023
Show file tree
Hide file tree
Showing 29 changed files with 48 additions and 45 deletions.
4 changes: 2 additions & 2 deletions man/MC.hitormiss.Rd
Expand Up @@ -11,9 +11,9 @@ MC.hitormiss(FUN = function(x) x - x^2, n = ani.options("nmax"), from = 0, to =

\item{n}{number of points to be sampled from the Uniform(0, 1) distribution}

\item{from, to}{the limits of integration}
\item{from, to}{the limits of integration}

\item{col.points, pch.points}{colors and point characters for points which
\item{col.points, pch.points}{colors and point characters for points which
``hit'' or ``miss'' the area under the curve}

\item{\dots}{other arguments passed to \code{\link{points}}}
Expand Down
8 changes: 4 additions & 4 deletions man/Rosling.bubbles.Rd
Expand Up @@ -9,22 +9,22 @@ Rosling.bubbles(x, y, data, type = c("circles", "squares", "rectangles", "stars"
text.col = rgb(0, 0, 0, 0.5), text.cex = 5)
}
\arguments{
\item{x, y}{the x and y co-ordinates for the centres of the bubbles (symbols).
\item{x, y}{the x and y co-ordinates for the centres of the bubbles (symbols).
Default to be 10 uniform random numbers in [0, 1] for each single image
frame (so the length should be 10 * \code{ani.options('nmax')})}
\item{type, data}{the type and data for symbols; see \code{\link{symbols}}.
\item{type, data}{the type and data for symbols; see \code{\link{symbols}}.
The default type is \code{circles}.}
\item{bg, main, xlim, ylim, xlab, ylab, ...}{see \code{\link{symbols}}. Note that
\item{bg, main, xlim, ylim, xlab, ylab, ...}{see \code{\link{symbols}}. Note that
\code{bg} has default values taking semi-transparent colors.}
\item{grid}{logical; add a grid to the plot?}
\item{text}{a character vector to be added to the plot one by one (e.g. the
year in Rosling's talk)}

\item{text.col, text.cex}{color and magnification of the background text}
\item{text.col, text.cex}{color and magnification of the background text}
}
\value{
\code{NULL}.
Expand Down
5 changes: 3 additions & 2 deletions man/ani.options.Rd
Expand Up @@ -81,8 +81,9 @@ Please note that \code{nmax} is not always equal to the number of
character string, it will be used as the footer message; in other cases,
the footer of the page will be blank.}
\item{loop}{whether to iterate or not (default \code{TRUE} to iterate for
infinite times)}
\item{loop}{logical or numeric: Number of times the GIF animation is to
cycle through the image sequence before stopping. By default, this is
set to zero or boolean value TRUE (infinite loop).}
\item{autobrowse}{logical: whether auto-browse the animation page
immediately after it is created? (default to be \code{interactive()})}
Expand Down
2 changes: 1 addition & 1 deletion man/bisection.method.Rd
Expand Up @@ -17,7 +17,7 @@ for the root; in a \code{c(a, b)} form}
\item{interact}{logical; whether choose the end-points by cliking on the
curve (for two times) directly?}

\item{xlab, ylab, main}{axis and main titles to be used in the plot}
\item{xlab, ylab, main}{axis and main titles to be used in the plot}

\item{\dots}{other arguments passed to \code{\link{curve}}}
}
Expand Down
2 changes: 1 addition & 1 deletion man/boot.iid.Rd
Expand Up @@ -15,7 +15,7 @@ interest when applied to the data x.}

\item{m}{the sample size for bootstrapping (\eqn{m}-out-of-\eqn{n} bootstrap)}

\item{mat, widths, heights}{arguments passed to \code{\link{layout}} to set the
\item{mat, widths, heights}{arguments passed to \code{\link{layout}} to set the
layout of the two graphs}

\item{col}{a character vector of length 5 specifying the colors of: points of
Expand Down
2 changes: 1 addition & 1 deletion man/boot.lowess.Rd
Expand Up @@ -6,7 +6,7 @@
boot.lowess(x, y = NULL, f = 2/3, iter = 3, line.col = "#FF000033", ...)
}
\arguments{
\item{x, y, f, iter}{passed to \code{\link{lowess}}}
\item{x, y, f, iter}{passed to \code{\link{lowess}}}

\item{line.col}{the color of the LOWESS lines}

Expand Down
2 changes: 1 addition & 1 deletion man/brownian.motion.Rd
Expand Up @@ -8,7 +8,7 @@ brownian.motion(n = 10, xlim = c(-20, 20), ylim = c(-20, 20), ...)
\arguments{
\item{n}{Number of points in the scatterplot}

\item{xlim, ylim}{Arguments passed to \code{\link{plot.default}} to control
\item{xlim, ylim}{Arguments passed to \code{\link{plot.default}} to control
the apperance of the scatterplot (title, points, etc), see
\code{\link{points}} for details.}

Expand Down
2 changes: 1 addition & 1 deletion man/buffon.needle.Rd
Expand Up @@ -15,7 +15,7 @@ buffon.needle(l = 0.8, d = 1, redraw = TRUE, mat = matrix(c(1, 3, 2, 3), 2),
\item{redraw}{logical. redraw former `needles' or not for each drop.}

\item{mat, heights}{arguments passed to \code{\link{layout}} to set the layout
\item{mat, heights}{arguments passed to \code{\link{layout}} to set the layout
of the three graphs.}

\item{col}{a character vector of length 7 specifying the colors of:
Expand Down
4 changes: 2 additions & 2 deletions man/clt.ani.Rd
Expand Up @@ -15,7 +15,7 @@ to create the histogram}
\item{FUN}{the function to generate \code{n} random numbers from a certain
distribution}

\item{mean, sd}{the expectation and standard deviation of the population
\item{mean, sd}{the expectation and standard deviation of the population
distribution (they will be used to plot the density curve of the
theoretical Normal distribution with mean equal to \code{mean} and sd equal
to \eqn{sd/\sqrt{n}}; if any of them is \code{NA}, the density curve will
Expand All @@ -25,7 +25,7 @@ be suppressed)}
density curve of the sample mean, the theoretical density cuve and
P-values.}

\item{mat, widths, heights}{arguments passed to \code{\link{layout}} to set the
\item{mat, widths, heights}{arguments passed to \code{\link{layout}} to set the
layout of the two graphs.}

\item{xlim}{the x-axis limit for the histogram (it has a default value if not
Expand Down
6 changes: 3 additions & 3 deletions man/ecol.death.sim.Rd
Expand Up @@ -7,14 +7,14 @@ ecol.death.sim(nr = 10, nc = 10, num.sp = c(50, 50), col.sp = c(1, 2), pch.sp =
2), col.die = 1, pch.die = 4, cex = 3, ...)
}
\arguments{
\item{nr, nc}{number of rows and columns of the field (plants grow on a
\item{nr, nc}{number of rows and columns of the field (plants grow on a
\code{nr} x \code{nc} grid)}

\item{num.sp}{number of two plants respectively}

\item{col.sp, pch.sp}{colors and point symbols of the two species respectively}
\item{col.sp, pch.sp}{colors and point symbols of the two species respectively}

\item{col.die, pch.die, cex}{the color, point symbol and magnification to
\item{col.die, pch.die, cex}{the color, point symbol and magnification to
annotate the plant which dies (symbol default to be an `X')}
\item{\dots}{other arguments passed to \code{\link{plot}} to set up the plot}
Expand Down
2 changes: 1 addition & 1 deletion man/flip.coin.Rd
Expand Up @@ -19,7 +19,7 @@ probabilities.}

\item{col}{The colors to annotate different faces of the `coin'.}
\item{type, pch, bg}{See \code{\link{points}}.}
\item{type, pch, bg}{See \code{\link{points}}.}
\item{digits}{integer indicating the precision to be used in the annotation
of frequencies in the plot}
Expand Down
2 changes: 1 addition & 1 deletion man/g.brownian.motion.Rd
Expand Up @@ -16,7 +16,7 @@ but it's the required by the Google gadget}
\item{file}{the HTML filename}
\item{width, height}{width and height of the animation}
\item{width, height}{width and height of the animation}
}
\value{
\code{NULL}. An HTML page will be opened as the side effect.
Expand Down
2 changes: 1 addition & 1 deletion man/grad.desc.Rd
Expand Up @@ -36,7 +36,7 @@ for contours)}
\item{interact}{logical; whether choose the starting values by clicking on the
contour plot directly?}

\item{col.contour, col.arrow}{colors for the contour lines and arrows
\item{col.contour, col.arrow}{colors for the contour lines and arrows
respectively (default to be red and blue)}

\item{main}{the title of the plot; if missing, it will be derived from
Expand Down
2 changes: 1 addition & 1 deletion man/kmeans.ani.Rd
Expand Up @@ -18,7 +18,7 @@ is chosen as the initial centres.}
\item{hints}{Two text strings indicating the steps of k-means clustering:
move the center or find the cluster membership?}

\item{pch, col}{Symbols and colors for different clusters; the length of these
\item{pch, col}{Symbols and colors for different clusters; the length of these
two arguments should be equal to the number of clusters, or they will be
recycled.}
}
Expand Down
2 changes: 1 addition & 1 deletion man/knn.ani.Rd
Expand Up @@ -29,7 +29,7 @@ data and test data.}

\item{cl.pch}{a vector specifying symbols for each class}

\item{dist.lty, dist.col}{the line type and color to annotate the distances}
\item{dist.lty, dist.col}{the line type and color to annotate the distances}

\item{knn.col}{the color to annotate the k-nearest neighbour points using a
polygon}
Expand Down
8 changes: 4 additions & 4 deletions man/least.squares.Rd
Expand Up @@ -18,22 +18,22 @@ of y (\code{x = 1:n} and \code{y = a + b * x + rnorm(n)})}
\item{ani.type}{\code{'slope'}: the slope is changing with the intercept
fixed; \code{'intercept'}: intercept changing and slope fixed}

\item{a, b}{the fixed intercept and slope; depending on \code{ani.type}, we
\item{a, b}{the fixed intercept and slope; depending on \code{ani.type}, we
only need to specify one of them; e.g. when \code{ani.type == 'slope'}, we
need to specify the value of \code{a}}

\item{a.range, b.range}{a vector of length 2 to define the range of the
\item{a.range, b.range}{a vector of length 2 to define the range of the
intercept and the slope; only one of them need to be specified; see above}

\item{ab.col}{the colors of two lines: the real regression line and the
moving line with either intercept or slope changing}

\item{est.pch}{the point character of the 'estimated' values given \code{x}}

\item{v.col, v.lty}{the color and line type of the vetical lines which
\item{v.col, v.lty}{the color and line type of the vetical lines which
demonstrate the residuals}

\item{rss.pch, rss.type}{the point character and plot type of the residual
\item{rss.pch, rss.type}{the point character and plot type of the residual
plot}

\item{mfrow}{defines the layout of the graph; see \code{\link{par}}}
Expand Down
2 changes: 1 addition & 1 deletion man/mwar.ani.Rd
Expand Up @@ -15,7 +15,7 @@ mwar.ani(x, k = 15, conf = 2, mat = matrix(1:2, 2), widths = rep(1, ncol(mat)),
\item{conf}{a positive number: the confidence intervals are computed as
\code{c(ar1 - conf*s.e., ar1 + conf*s.e.)}}

\item{mat, widths, heights}{arguments passed to \code{\link{layout}} to divide
\item{mat, widths, heights}{arguments passed to \code{\link{layout}} to divide
the device into 2 parts}

\item{lty.rect}{the line type of the rectangles respresenting the moving
Expand Down
2 changes: 1 addition & 1 deletion man/newton.method.Rd
Expand Up @@ -23,7 +23,7 @@ curve (for 1 time) directly?}
\item{col.lp}{a vector of length 3 specifying the colors of: vertical lines,
tangent lines and points}

\item{main, xlab, ylab}{titles of the plot; there are default values for them
\item{main, xlab, ylab}{titles of the plot; there are default values for them
(depending on the form of the function \code{FUN})}

\item{\dots}{other arguments passed to \code{\link{curve}}}
Expand Down
2 changes: 1 addition & 1 deletion man/price.ani.Rd
Expand Up @@ -16,7 +16,7 @@ minimum \code{time})}

\item{span}{time span (unit in seconds; default to be 15 minutes)}

\item{xlab, ylab, xlim, ylim, main}{they are passed to \code{\link{plot}} with
\item{xlab, ylab, xlim, ylim, main}{they are passed to \code{\link{plot}} with
reasonable default values}

\item{\dots}{other arguments passed to \code{\link{plot}}}
Expand Down
2 changes: 1 addition & 1 deletion man/quincunx.Rd
Expand Up @@ -18,7 +18,7 @@ quincunx2(balls = 200, layers = 15, pch.layers = 2, pch.balls = 19,
\item{pch.layers}{point character of layers; triangles (\code{pch = 2}) are
recommended}

\item{pch.balls, col.balls, cex.balls}{point character, colors and
\item{pch.balls, col.balls, cex.balls}{point character, colors and
magnification of balls}
}
\value{
Expand Down
2 changes: 1 addition & 1 deletion man/sample.cluster.Rd
Expand Up @@ -11,7 +11,7 @@ sample.cluster(pop = ceiling(10 * runif(10, 0.2, 1)), size = 3, p.col = c("blue"

\item{size}{the number of clusters to be drawn out.}

\item{p.col, p.cex}{different colors / magnification rate to annotate the
\item{p.col, p.cex}{different colors / magnification rate to annotate the
population and the sample}

\item{\dots}{other arguments passed to \code{\link{rect}} to annotate the
Expand Down
2 changes: 1 addition & 1 deletion man/sample.ratio.Rd
Expand Up @@ -16,7 +16,7 @@ sample.ratio(X = runif(50, 0, 5), R = 1, Y = R * X + rnorm(X), size = length(X)/

\item{size}{sample size}

\item{p.col, p.cex, p.pch}{point colors, magnification and symbols for the
\item{p.col, p.cex, p.pch}{point colors, magnification and symbols for the
population and sample respectively}

\item{m.col}{color for the horizontal line to denote the sample mean of Y}
Expand Down
2 changes: 1 addition & 1 deletion man/sample.simple.Rd
Expand Up @@ -13,7 +13,7 @@ sample.simple(nrow = 10, ncol = 10, size = 15, p.col = c("blue", "red"), p.cex =

\item{size}{the sample size.}

\item{p.col, p.cex}{different colors /magnification rate to annotate the
\item{p.col, p.cex}{different colors /magnification rate to annotate the
population and the sample}
}
\value{
Expand Down
2 changes: 1 addition & 1 deletion man/sample.strat.Rd
Expand Up @@ -13,7 +13,7 @@ sample.strat(pop = ceiling(10 * runif(10, 0.5, 1)), size = ceiling(pop *
\item{size}{a corresponding vector for the sample size in each stratum
(recycled if necessary).}

\item{p.col, p.cex}{different colors /magnification rate to annotate the
\item{p.col, p.cex}{different colors /magnification rate to annotate the
population and the sample}

\item{\dots}{other arguments passed to \code{\link{rect}} to annotate the
Expand Down
2 changes: 1 addition & 1 deletion man/sample.system.Rd
Expand Up @@ -13,7 +13,7 @@ sample.system(nrow = 10, ncol = 10, size = 15, p.col = c("blue", "red"), p.cex =

\item{size}{the sample size.}

\item{p.col, p.cex}{different colors / magnification rate to annotate the
\item{p.col, p.cex}{different colors / magnification rate to annotate the
population and the sample}
}
\value{
Expand Down
11 changes: 6 additions & 5 deletions man/saveGIF.Rd
Expand Up @@ -83,20 +83,21 @@ saveGIF({
for (i in 1:10) plot(runif(10), ylim = 0:1)
})

## if the above conversion was successful, the option 'convert' should not be NULL
## under Windows
## if the above conversion was successful, the option 'convert' should
## not be NULL under Windows
ani.options("convert")
## like 'C:/Software/LyX/etc/ImageMagick/convert.exe'

saveGIF({
brownian.motion(pch = 21, cex = 5, col = "red", bg = "yellow")
}, movie.name = "brownian_motion.gif", interval = 0.1, nmax = 30, ani.width = 600,
ani.height = 600)
}, movie.name = "brownian_motion.gif", interval = 0.1, nmax = ifelse(interactive(),
30, 2), ani.width = 600, ani.height = 600)

## non-constant intervals between image frames
saveGIF({
brownian.motion(pch = 21, cex = 5, col = "red", bg = "yellow")
}, movie.name = "brownian_motion2.gif", interval = runif(30, 0.01, 1), nmax = 30)
}, movie.name = "brownian_motion2.gif", interval = runif(30, 0.01, 1),
nmax = ifelse(interactive(), 30, 2))
}
\author{
Yihui Xie
Expand Down
2 changes: 1 addition & 1 deletion man/saveLatex.Rd
Expand Up @@ -27,7 +27,7 @@ the LaTeX macro \code{'\\animategraphics'}; default to be
\item{centering}{logical: whether to center the graph using the LaTeX
environment \verb{\begin{center}} and \verb{\end{center}}}

\item{caption, label}{caption and label for the graphics in the figure
\item{caption, label}{caption and label for the graphics in the figure
environment}

\item{pkg.opts}{global options for the \code{animate} package}
Expand Down
2 changes: 1 addition & 1 deletion man/saveVideo.Rd
Expand Up @@ -59,7 +59,7 @@ oopts = if (.Platform$OS.type == "windows") {
saveVideo({
par(mar = c(3, 3, 1, 0.5), mgp = c(2, 0.5, 0), tcl = -0.3, cex.axis = 0.8,
cex.lab = 0.8, cex.main = 1)
ani.options(interval = 0.05, nmax = 300)
ani.options(interval = 0.05, nmax = ifelse(interactive(), 300, 2))
brownian.motion(pch = 21, cex = 5, col = "red", bg = "yellow")
}, video.name = "BM.mp4", other.opts = "-pix_fmt yuv420p -b 300k")
# higher bitrate, better quality
Expand Down
5 changes: 3 additions & 2 deletions man/vanke1127.Rd
Expand Up @@ -20,10 +20,11 @@ plot(as.numeric(names(tab.price)), as.numeric(tab.price), type = 'h',
oopt = ani.options(interval = 0.5, loop = FALSE, title = 'Stock price of Vanke')

## a series of HTML animations with different time spans

saveHTML({
price.ani(vanke1127$price, vanke1127$time, lwd = 2)
price.ani(vanke1127$price, vanke1127$time, span = 15 * 60, lwd = 2)
}, img.name = 'vanke_a', description = 'Prices changing along with time interval 15 min',
htmlfile = "vanke1127_1.html")
htmlfile = "vanke1127_1.html")

saveHTML({
price.ani(vanke1127$price, vanke1127$time, span = 30 * 60, lwd = 3)
Expand Down

0 comments on commit f8e8023

Please sign in to comment.