Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix documentation cross-refs.

Includes exporting and documenting layer and waiver
  • Loading branch information...
commit 08461b8af081fd8e126166107eff700d148a2b31 1 parent f47bffa
@hadley authored
View
2  NAMESPACE
@@ -81,6 +81,7 @@ export(label_parsed)
export(label_value)
export(labs)
export(last_plot)
+export(layer)
export(map_data)
export(mean_cl_boot)
export(mean_cl_normal)
@@ -194,6 +195,7 @@ export(theme_text)
export(theme_update)
export(update_element)
export(update_labels)
+export(waiver)
export(xlab)
export(xlim)
export(ylab)
View
7 R/coord-map.r
@@ -7,9 +7,10 @@
#' a better (or more correct) way to do this, please let me know
#'
#' @export
-#' @param projection projection to use, see \code{\link{mapproject}} for
-#' list
-#' @param ... other arguments passed on to \code{\link{mapproject}}
+#' @param projection projection to use, see
+#' \code{\link[mapproj]{mapproject}} for list
+#' @param ... other arguments passed on to
+#' \code{\link[mapproj]{mapproject}}
#' @param orientation projection orientation, which defaults to
#' \code{c(90, 0, mean(range(x)))}. This is not optimal for many
#' projections, so you will have to supply your own.
View
15 R/fortify-map.r
@@ -5,7 +5,7 @@
#'
#' @method fortify map
#' @S3method fortify map
-#' @seealso \code{\link{map_data}} and \code{\link{border}}
+#' @seealso \code{\link{map_data}} and \code{\link{borders}}
#' @param model map object
#' @param data not used by this method
#' @param ... not used by this method
@@ -34,13 +34,14 @@ fortify.map <- function(model, data, ...) {
#' Create a data frame of map data.
#'
-#' @param map name of map provided by \code{\link{maps}} package. These
-#' include \code{\link{county}}, \code{\link{france}}, \code{\link{italy}},
-#' \code{\link{nz}}, \code{\link{state}}, \code{\link{usa}},
-#' \code{\link{world}}, \code{\link{world2}}.
+#' @param map name of map provided by the \pkg{maps} package. These
+#' include \code{\link[maps]{county}}, \code{\link[maps]{france}},
+#' \code{\link[maps]{italy}}, \code{\link[maps]{nz}},
+#' \code{\link[maps]{state}}, \code{\link[maps]{usa}},
+#' \code{\link[maps]{world}}, \code{\link[maps]{world2}}.
#' @param region name of subregions to include. Defaults to \code{.} which
-#' includes all subregion. See documentation for \code{\link{map}} for
-#' more details.
+#' includes all subregion. See documentation for \code{\link[maps]{map}}
+#' for more details.
#' @param exact should the \code{region} be treated as a regular expression
#' (\code{FALSE}) or as a fixed string (\code{TRUE}).
#' @param ... all other arguments passed on to \code{\link[maps]{map}}
View
2  R/fortify-multcomp.r
@@ -1,7 +1,7 @@
#' Fortify methods for objects produced by \pkg{multcomp}
#'
#' @param model an object of class \code{glht}, \code{confint.glht},
-#' \code{summary.glht} or \code{\link{cld}}
+#' \code{summary.glht} or \code{\link[multcomp]{cld}}
#' @param data,... other arguments to the generic ignored in this method.
#' @name fortify-multcomp
#' @examples
View
2  R/guide-colorbar.r
@@ -10,7 +10,7 @@
##'
##' @name guide_colorbar
##' @title Colorbar guide
-##' @param title A character string or expression indicating a title of guide. If \code{NULL}, the title is not shown. By default (\code{\link{waiver()}}), the name of the scale object or tha name specified in \code{\link{labs}} is used for the title.
+##' @param title A character string or expression indicating a title of guide. If \code{NULL}, the title is not shown. By default (\code{\link{waiver}}), the name of the scale object or tha name specified in \code{\link{labs}} is used for the title.
##' @param title.position A character string indicating the position of a title. One of "top" (default for a vertical guide), "bottom", "left" (default for a horizontal guide), or "right."
##' @param title.theme A theme object for rendering the title text. Usually the object of \code{\link{theme_text}} is expected. By default, the theme is specified by \code{legend.title} in \code{\link{opts}} or theme.
##' @param title.hjust A numeric specifying horizontal justification of the title text.
View
2  R/guide-legend.r
@@ -9,7 +9,7 @@
##'
##' @name guide_legend
##' @title Legend guide
-##' @param title A character string or expression indicating a title of guide. If \code{NULL}, the title is not shown. By default (\code{\link{waiver()}}), the name of the scale object or tha name specified in \code{\link{labs}} is used for the title.
+##' @param title A character string or expression indicating a title of guide. If \code{NULL}, the title is not shown. By default (\code{\link{waiver}}), the name of the scale object or tha name specified in \code{\link{labs}} is used for the title.
##' @param title.position A character string indicating the position of a title. One of "top" (default for a vertical guide), "bottom", "left" (default for a horizontal guide), or "right."
##' @param title.theme A theme object for rendering the title text. Usually the object of \code{\link{theme_text}} is expected. By default, the theme is specified by \code{legend.title} in \code{\link{opts}} or theme.
##' @param title.hjust A numeric specifying horizontal justification of the title text.
View
4 R/layer.r
@@ -231,6 +231,10 @@ Layer <- proto(expr = {
class <- function(.) "layer"
})
+#' Create a new layer
+#'
+#' @keywords internal
+#' @export
layer <- Layer$new
# Determine if aesthetic is calculated
View
2  R/plot-construction.r
@@ -15,7 +15,7 @@
#'
#' @param p plot object
#' @param object component to add
-#' @seealso \code{\link{set_last_plot}}, \code{\link{ggplot}}
+#' @seealso \code{\link{ggplot}}
#' @method + ggplot
#' @S3method "+" ggplot
#' @rdname ggplot-add
View
2  R/plot-render.r
@@ -151,7 +151,7 @@ ggplot_gtable <- function(data) {
#' @param x plot to display
#' @param newpage draw new (empty) page first?
#' @param vp viewport to draw plot in
-#' @param ... other arguments passed on to \code{\link{ggplotGrob}}
+#' @param ... other arguments not used by this method
#' @keywords hplot
#' @S3method print ggplot
#' @method print ggplot
View
11 R/utilities.r
@@ -165,8 +165,17 @@ should_stop <- function(expr) {
}
-# Waive decision
+#' A waiver object.
+#'
+#' A waiver is a "flag" object, similar to \code{NULL}, that indicates the
+#' calling function should just use the default value. It is used in certain
+#' functions to distinguish between displaying nothing (\code{NULL}) and
+#' displaying a default value calculated elsewhere (\code{waiver()})
+#'
+#' @export
+#' @keywords internal
waiver <- function() structure(NULL, class="waiver")
+
is.waive <- function(x) inherits(x, "waiver")
View
5 man/borders.Rd
@@ -22,8 +22,7 @@
Create a layer of map borders.
}
\examples{
-require("maps")
-require("ggplot2")
+if (require("maps")) {
ia <- map_data("county", "iowa")
mid_range <- function(x) mean(range(x))
@@ -38,5 +37,7 @@ ggplot(capitals, aes(long, lat)) +
borders("state") +
geom_point(aes(size = pop)) +
scale_area()
+
+}
}
View
4 man/coord_map.Rd
@@ -7,10 +7,10 @@
}
\arguments{
\item{projection}{projection to use, see
- \code{\link{mapproject}} for list}
+ \code{\link[mapproj]{mapproject}} for list}
\item{...}{other arguments passed on to
- \code{\link{mapproject}}}
+ \code{\link[mapproj]{mapproject}}}
\item{orientation}{projection orientation, which defaults
to \code{c(90, 0, mean(range(x)))}. This is not optimal
View
2  man/fortify-multcomp.Rd
@@ -17,7 +17,7 @@
\arguments{
\item{model}{an object of class \code{glht},
\code{confint.glht}, \code{summary.glht} or
- \code{\link{cld}}}
+ \code{\link[multcomp]{cld}}}
\item{data,...}{other arguments to the generic ignored in
this method.}
View
2  man/fortify.map.Rd
@@ -28,6 +28,6 @@ qplot(long, lat, data = tx, geom = "polygon", group = group,
}
}
\seealso{
- \code{\link{map_data}} and \code{\link{border}}
+ \code{\link{map_data}} and \code{\link{borders}}
}
View
2  man/ggplot-add.Rd
@@ -25,6 +25,6 @@
override current coordinate faceting }
}
\seealso{
- \code{\link{set_last_plot}}, \code{\link{ggplot}}
+ \code{\link{ggplot}}
}
View
6 man/guide_colorbar.Rd
@@ -15,9 +15,9 @@
\arguments{
\item{title}{A character string or expression indicating
a title of guide. If \code{NULL}, the title is not shown.
- By default (\code{\link{waiver()}}), the name of the
- scale object or tha name specified in \code{\link{labs}}
- is used for the title.}
+ By default (\code{\link{waiver}}), the name of the scale
+ object or tha name specified in \code{\link{labs}} is
+ used for the title.}
\item{title.position}{A character string indicating the
position of a title. One of "top" (default for a vertical
View
6 man/guide_legend.Rd
@@ -15,9 +15,9 @@
\arguments{
\item{title}{A character string or expression indicating
a title of guide. If \code{NULL}, the title is not shown.
- By default (\code{\link{waiver()}}), the name of the
- scale object or tha name specified in \code{\link{labs}}
- is used for the title.}
+ By default (\code{\link{waiver}}), the name of the scale
+ object or tha name specified in \code{\link{labs}} is
+ used for the title.}
\item{title.position}{A character string indicating the
position of a title. One of "top" (default for a vertical
View
11 man/layer.Rd
@@ -0,0 +1,11 @@
+\name{layer}
+\alias{layer}
+\title{Create a new layer}
+\usage{
+ layer(...)
+}
+\description{
+ Create a new layer
+}
+\keyword{internal}
+
View
13 man/map_data.Rd
@@ -5,15 +5,16 @@
map_data(map, region = ".", exact = FALSE, ...)
}
\arguments{
- \item{map}{name of map provided by \code{\link{maps}}
- package. These include \code{\link{county}},
- \code{\link{france}}, \code{\link{italy}},
- \code{\link{nz}}, \code{\link{state}}, \code{\link{usa}},
- \code{\link{world}}, \code{\link{world2}}.}
+ \item{map}{name of map provided by the \pkg{maps}
+ package. These include \code{\link[maps]{county}},
+ \code{\link[maps]{france}}, \code{\link[maps]{italy}},
+ \code{\link[maps]{nz}}, \code{\link[maps]{state}},
+ \code{\link[maps]{usa}}, \code{\link[maps]{world}},
+ \code{\link[maps]{world2}}.}
\item{region}{name of subregions to include. Defaults to
\code{.} which includes all subregion. See documentation
- for \code{\link{map}} for more details.}
+ for \code{\link[maps]{map}} for more details.}
\item{exact}{should the \code{region} be treated as a
regular expression (\code{FALSE}) or as a fixed string
View
3  man/print.ggplot.Rd
@@ -12,8 +12,7 @@
\item{vp}{viewport to draw plot in}
- \item{...}{other arguments passed on to
- \code{\link{ggplotGrob}}}
+ \item{...}{other arguments not used by this method}
}
\description{
Draw plot on current graphics device.
View
16 man/waiver.Rd
@@ -0,0 +1,16 @@
+\name{waiver}
+\alias{waiver}
+\title{A waiver object.}
+\usage{
+ waiver()
+}
+\description{
+ A waiver is a "flag" object, similar to \code{NULL}, that
+ indicates the calling function should just use the
+ default value. It is used in certain functions to
+ distinguish between displaying nothing (\code{NULL}) and
+ displaying a default value calculated elsewhere
+ (\code{waiver()})
+}
+\keyword{internal}
+
Please sign in to comment.
Something went wrong with that request. Please try again.