Permalink
Browse files

Documentation improvements for website

  • Loading branch information...
1 parent 4bb6aa3 commit abfcd2fcd3075d74ad5db3e49b9076434f6e1182 @hadley hadley committed May 22, 2012
Showing with 120 additions and 38 deletions.
  1. +0 −1 NAMESPACE
  2. +0 −1 R/ggplot2.r
  3. +4 −2 R/labels.r
  4. +4 −2 R/scale-identity.r
  5. +4 −2 R/scale-manual.r
  6. +1 −1 R/scale-size.r
  7. +1 −1 README.md
  8. +0 −1 man/ggplot2.Rd
  9. +6 −4 man/opts.Rd
  10. +2 −2 man/scale_identity.Rd
  11. +2 −2 man/scale_manual.Rd
  12. +1 −2 man/scale_size.Rd
  13. +95 −17 staticdocs.r
View
@@ -151,7 +151,6 @@ export(scale_shape_discrete)
export(scale_shape_identity)
export(scale_shape_manual)
export(scale_shape)
-export(scale_size_continuous)
export(scale_size_discrete)
export(scale_size_identity)
export(scale_size_manual)
View
@@ -2,7 +2,6 @@
#'
#' @name ggplot2
#' @docType package
-#' @aliases ggplot2 package-ggplot2
#' @import plyr digest scales grid reshape2 memoise proto
NULL
View
@@ -17,8 +17,6 @@ update_labels <- function(p, labels) {
#' Change axis labels and legend titles
#'
#' @param ... a list of new names in the form aesthetic = "new name"
-#' @aliases labs xlab ylab
-#' @export labs xlab ylab
#' @examples
#' p <- qplot(mpg, wt, data = mtcars)
#' p + labs(x = "New x label")
@@ -43,9 +41,13 @@ labs <- function(...) {
structure(args, class = "labels")
}
+#' @rdname labs
+#' @export
xlab <- function(label) {
labs(x = label)
}
+#' @rdname labs
+#' @export
ylab <- function(label) {
labs(y = label)
}
View
@@ -1,10 +1,9 @@
#' Use values without scaling.
#'
+#' @name scale_identity
#' @param ... Other arguments passed on to \code{\link{discrete_scale}} or
#' \code{\link{continuous_scale}}
#' @param guide Guide to use for this scale - defaults to \code{"none"}.
-#' @rdname scale_identity
-#' @export
#' @examples
#' colour <- c("red", "green", "blue", "yellow")
#' qplot(1:4, 1:4, fill = colour, geom = "tile")
@@ -23,6 +22,9 @@
#'
#' # cyl used as point size
#' qplot(mpg, wt, data = mtcars, size = cyl) + scale_size_identity()
+
+#' @rdname scale_identity
+#' @export scale_colour_identity
scale_colour_identity <- function(..., guide = "none") {
identity_scale(discrete_scale("colour", "identity", identity_pal(), ..., guide = guide))
}
View
@@ -1,13 +1,12 @@
#' Create your own discrete scale.
#'
-#' @rdname scale_manual
+#' @name scale_manual
#' @inheritParams scale_x_discrete
#' @param values a set of aesthetic values to map data values to. If this
#' is a named vector, then the values will be matched based on the names.
#' If unnamed, values will be matched in order (usually alphabetical, but
#' could be modified with the limits argument to the scale). Any data
#' values that don't match, will be given \code{na.value}.
-#' @export
#' @examples
#' \donttest{
#' p <- qplot(mpg, wt, data = mtcars, colour = factor(cyl))
@@ -31,6 +30,9 @@
#' p + scale_colour_manual(values = cols, limits = c("4", "8"))
#' p + scale_colour_manual(values = cols, limits = c("4", "6", "8", "10"))
#' }
+
+#' @rdname scale_manual
+#' @export scale_colour_manual
scale_colour_manual <- function(..., values) {
manual_scale("colour", values, ...)
}
View
@@ -3,7 +3,7 @@
#' @inheritParams scale_x_continuous
#' @param range a numeric vector of length 2 that specifies the minimum and
#' maximum size of the plotting symbol after transformation.
-#' @rdname scale_size
+#' @name scale_size
#' @export
#' @examples
#' \donttest{
View
@@ -16,7 +16,7 @@ examples of ggplot in use. If you're interested, you can also sign up to
the ggplot2 mailing list at http://groups.google.com/group/ggplot2, or track
development at http://github.com/hadley/ggplot2
-# Development
+## Development
To install the development version of ggplot2, it's easiest to use the `devtools` package:
View
@@ -2,7 +2,6 @@
\name{ggplot2}
\alias{ggplot2}
\alias{ggplot2-package}
-\alias{package-ggplot2}
\title{ggplot2.}
\description{
ggplot2.
View
@@ -44,10 +44,12 @@
\cr panel.grid.major \tab major grid lines \cr
panel.grid.minor \tab minor grid lines \cr
plot.background \tab background of the entire plot \cr
- plot.title \tab plot title \cr plot.margin \tab plot
- margins \cr strip.background \tab background of facet
- labels \cr strip.text.x \tab text for horizontal strips
- \cr strip.text.y \tab text for vertical strips \cr }
+ plot.title \tab plot title (text appearance) \cr
+ plot.margin \tab plot margins \cr strip.background \tab
+ background of facet labels \cr strip.text.x \tab text for
+ horizontal strips \cr strip.text.y \tab text for vertical
+ strips \cr title \tab A string containing the title of
+ the plot \cr }
}
\examples{
\donttest{
View
@@ -1,8 +1,8 @@
-\name{scale_colour_identity}
+\name{scale_identity}
\alias{scale_alpha_identity}
\alias{scale_color_identity}
-\alias{scale_colour_identity}
\alias{scale_fill_identity}
+\alias{scale_identity}
\alias{scale_linetype_identity}
\alias{scale_shape_identity}
\alias{scale_size_identity}
View
@@ -1,9 +1,9 @@
-\name{scale_colour_manual}
+\name{scale_manual}
\alias{scale_alpha_manual}
\alias{scale_color_manual}
-\alias{scale_colour_manual}
\alias{scale_fill_manual}
\alias{scale_linetype_manual}
+\alias{scale_manual}
\alias{scale_shape_manual}
\alias{scale_size_manual}
\title{Create your own discrete scale.}
View
@@ -1,6 +1,5 @@
-\name{scale_size_continuous}
+\name{scale_size}
\alias{scale_size}
-\alias{scale_size_continuous}
\alias{scale_size_discrete}
\title{Size scale.}
\usage{
View
@@ -1,5 +1,6 @@
library(staticdocs)
list(
+ readme = "",
index = list(
sd_section("Geoms",
"Geoms, short for geometric objects, describe the type of plot you will produce.",
@@ -14,6 +15,7 @@ list(
"geom_crossbar",
"geom_density",
"geom_density2d",
+ "geom_dotplot",
"geom_errorbar",
"geom_errorbarh",
"geom_freqpoly",
@@ -23,11 +25,13 @@ list(
"geom_jitter",
"geom_line",
"geom_linerange",
+ "geom_map",
"geom_path",
"geom_point",
"geom_pointrange",
"geom_polygon",
"geom_quantile",
+ "geom_raster",
"geom_rect",
"geom_ribbon",
"geom_rug",
@@ -36,59 +40,67 @@ list(
"geom_step",
"geom_text",
"geom_tile",
+ "geom_violin",
"geom_vline"
)
),
sd_section("Statistics",
"It's often useful to transform your data before plotting, and that's what statistical transformations do.",
c(
- "stat_abline",
"stat_bin",
"stat_bin2d",
+ "stat_bindot",
"stat_binhex",
"stat_boxplot",
"stat_contour",
"stat_density",
"stat_density2d",
"stat_function",
- "stat_hline",
"stat_identity",
"stat_qq",
"stat_quantile",
"stat_smooth",
"stat_spoke",
"stat_sum",
"stat_summary",
+ "stat_summary_hex",
+ "stat_summary2d",
"stat_unique",
- "stat_vline"
+ "stat_ydensity"
)
),
sd_section("Scales",
"Scales control the mapping between data and aesthetics.",
c(
+ "expand_limits",
+ "guide_legend",
+ "guide_colourbar",
"scale_alpha",
- "scale_continuous",
- "scale_datetime",
- "scale_gradient",
- "scale_gradientn",
- "scale_hue",
- "scale_linetype",
- "scale_shape",
- "scale_brewer",
- "scale_date",
- "scale_discrete",
- "scale_gradient2",
- "scale_grey",
+ "scale_area",
+ "scale_colour_gradient2",
+ "scale_colour_gradientn",
+ "scale_colour_grey",
+ "scale_colour_hue",
"scale_identity",
"scale_manual",
- "scale_size"
+ "scale_linetype",
+ "scale_shape",
+ "scale_size",
+ "scale_x_continuous",
+ "scale_x_date",
+ "scale_x_datetime",
+ "scale_x_discrete",
+ "labs",
+ "update_labels",
+ "xlim",
+ "ylim"
)
),
sd_section("Coordinate systems",
"Coordinate systems adjust the mapping from coordinates to the 2d plane of the computer screen.",
c(
"coord_cartesian",
- "coord_equal",
+ "coord_fixed",
"coord_flip",
"coord_map",
"coord_polar",
@@ -100,6 +112,7 @@ list(
"Facets display subsets of the dataset in different panels.",
c(
"facet_grid",
+ "facet_null",
"facet_wrap"
)
),
@@ -113,7 +126,72 @@ list(
"position_stack",
"position_jitter"
)
+ ),
+ sd_section("Data",
+ "Data sets included in ggplot2 and used in examples",
+ c(
+ "diamonds",
+ "economics",
+ "midwest",
+ "movies",
+ "mpg",
+ "msleep",
+ "presidential",
+ "seals"
+ )
+ ),
+ sd_section("Anotation",
+ "Specialised functions for adding annotations to a plot",
+ c(
+ "annotate",
+ "annotation_custom",
+ "annotation_logticks",
+ "annotation_map",
+ "annotation_raster",
+ "borders"
+ )
+ ),
+ sd_section("Fortify",
+ "Fortify methods make it possible to use ggplot2 with objects of
+ various types, not just data frames.",
+ c(
+ "fortify",
+ "fortify-multcomp",
+ "fortify.lm",
+ "fortify.map",
+ "fortify.sp",
+ "map_data"
+ )
+ ),
+ sd_section("Themes",
+ "Themes control non-data components of the plot",
+ c(
+ "opts",
+ "theme_blank",
+ "theme_bw",
+ "theme_grey",
+ "theme_line",
+ "theme_rect",
+ "theme_segment",
+ "theme_text",
+ "theme_update",
+ "update_element"
+ )
+ ),
+ sd_section("Aesthetics",
+ "",
+ c(
+ "aes",
+ "aes_all",
+ "aes_auto",
+ "aes_string",
+ "aes_colour_fill_alpha",
+ "aes_group_order",
+ "aes_linetype_size_shape",
+ "aes_position"
+ )
)
+
),
icons = list(
coord_polar = sd_icon({

0 comments on commit abfcd2f

Please sign in to comment.