Docs Ggplot2 Org

Embed Size (px)

Citation preview

  • 7/26/2019 Docs Ggplot2 Org

    1/6

    ggplot2 2.1.0

    Help topicsGeomsGeoms, short for geometric objects, describe the type of plot you will produce.

    geom_abline (geom_hline, geom_vline)

    Lines: horizontal, vertical, and specified by slope and intercept.geom_bar (stat_count)

    Bars, rectangles with bases on x-axis

    geom_bin2d (stat_bin2d, stat_bin_2d)

    Add heatmap of 2d bin counts.

    geom_blank

    Blank, draws nothing.

    geom_boxplot (stat_boxplot)

    Box and whiskers plot.

    geom_contour (stat_contour)

    Display contours of a 3d surface in 2d.

    geom_count (stat_sum)

    Count the number of observations at each location.

    geom_crossbar (geom_errorbar, geom_linerange, geom_pointrange)

    Vertical intervals: lines, crossbars & errorbars.

    geom_density (stat_density)

    Display a smooth density estimate.

    geom_density_2d (geom_density2d, stat_density2d, stat_density_2d)

    Contours from a 2d density estimate.

    geom_dotplot

    Dot plot

    geom_errorbarh

    Horizontal error bars

    geom_freqpoly (geom_histogram, stat_bin)Histograms and frequency polygons.

    geom_hex (stat_bin_hex, stat_binhex)

    Hexagon binning.

    geom_jitter

    Points, jittered to reduce overplotting.

    geom_label (geom_text)

    Textual annotations.

    geom_map

    Polygons from a reference map.

    geom_path (geom_line, geom_step)

    Connect observations.

    geom_point

    Points, as for a scatterplot

    geom_polygon

    Polygon, a filled path.

    geom_quantile (stat_quantile)

    Add quantile lines from a quantile regression.

    geom_raster (geom_rect, geom_tile)

    Draw rectangles.

    geom_ribbon (geom_area)

    Ribbons and area plots.

    geom_rug

    Marginal rug plots.geom_segment (geom_curve)

    Line segments and curves.

    geom_smooth (stat_smooth)

    Add a smoothed conditional mean.

    Index

    converted by Web2PDFConvert.com

    http://docs.ggplot2.org/current/geom_ribbon.htmlhttp://docs.ggplot2.org/current/geom_point.htmlhttp://docs.ggplot2.org/current/geom_path.htmlhttp://docs.ggplot2.org/current/geom_hex.htmlhttp://docs.ggplot2.org/current/geom_histogram.htmlhttp://docs.ggplot2.org/current/geom_density.htmlhttp://docs.ggplot2.org/current/geom_linerange.htmlhttp://docs.ggplot2.org/current/geom_blank.htmlhttp://docs.ggplot2.org/current/geom_bin2d.htmlhttp://docs.ggplot2.org/current/index.htmlhttp://www.web2pdfconvert.com/?ref=PDFhttp://www.web2pdfconvert.com/?ref=PDFhttp://docs.ggplot2.org/current/geom_smooth.htmlhttp://docs.ggplot2.org/current/geom_segment.htmlhttp://docs.ggplot2.org/current/geom_rug.htmlhttp://docs.ggplot2.org/current/geom_ribbon.htmlhttp://docs.ggplot2.org/current/geom_tile.htmlhttp://docs.ggplot2.org/current/geom_quantile.htmlhttp://docs.ggplot2.org/current/geom_polygon.htmlhttp://docs.ggplot2.org/current/geom_point.htmlhttp://docs.ggplot2.org/current/geom_path.htmlhttp://docs.ggplot2.org/current/geom_map.htmlhttp://docs.ggplot2.org/current/geom_text.htmlhttp://docs.ggplot2.org/current/geom_jitter.htmlhttp://docs.ggplot2.org/current/geom_hex.htmlhttp://docs.ggplot2.org/current/geom_histogram.htmlhttp://docs.ggplot2.org/current/geom_errorbarh.htmlhttp://docs.ggplot2.org/current/geom_dotplot.htmlhttp://docs.ggplot2.org/current/geom_density_2d.htmlhttp://docs.ggplot2.org/current/geom_density.htmlhttp://docs.ggplot2.org/current/geom_linerange.htmlhttp://docs.ggplot2.org/current/geom_count.htmlhttp://docs.ggplot2.org/current/geom_contour.htmlhttp://docs.ggplot2.org/current/geom_boxplot.htmlhttp://docs.ggplot2.org/current/geom_blank.htmlhttp://docs.ggplot2.org/current/geom_bin2d.htmlhttp://docs.ggplot2.org/current/geom_bar.htmlhttp://docs.ggplot2.org/current/geom_abline.htmlhttp://docs.ggplot2.org/current/index.html
  • 7/26/2019 Docs Ggplot2 Org

    2/6

    geom_violin (stat_ydensity)

    Violin plot.

    StatisticsIt's often useful to transform your data before plotting, and that's what statistical transformations do.

    stat_ecdf

    Empirical Cumulative Density Function

    stat_ellipse

    Plot data ellipses.

    stat_functionSuperimpose a function.

    stat_identity

    Identity statistic.

    stat_qq (geom_qq)

    Calculation for quantile-quantile plot.

    stat_summary_2d (stat_summary2d, stat_summary_hex)

    Bin and summarise in 2d (rectangle & hexagons)

    stat_unique

    Remove duplicates.

    Scales

    Scales control the mapping between data and aesthetics.expand_limits

    Expand the plot limits with data.

    guides

    Set guides for each scale.

    guide_legend

    Legend guide.

    guide_colourbar (guide_colorbar)

    Continuous colour bar guide.

    lims (xlim, ylim)

    Convenience functions to set the axis limits.

    scale_alpha (scale_alpha_continuous, scale_alpha_discrete)

    Alpha scales.

    scale_colour_brewer (scale_color_brewer, scale_color_distiller, scale_colour_distiller, scale_fill_brewer, scale_fill_distiller)

    Sequential, diverging and qualitative colour scales from colorbrewer.org

    scale_colour_gradient (scale_color_continuous, scale_color_gradient, scale_color_gradient2, scale_color_gradientn,

    scale_colour_continuous, scale_colour_date, scale_colour_datetime, scale_colour_gradient2, scale_colour_gradientn, scale_fill_continuous,

    scale_fill_date, scale_fill_datetime, scale_fill_gradient, scale_fill_gradient2, scale_fill_gradientn)

    Smooth gradient between two colours

    scale_colour_grey (scale_color_grey, scale_fill_grey)

    Sequential grey colour scale.

    scale_colour_hue (scale_color_discrete, scale_color_hue, scale_colour_discrete, scale_fill_discrete, scale_fill_hue)

    Qualitative colour scale with evenly spaced hues.

    scale_identity (scale_alpha_identity, scale_color_identity, scale_colour_identity, scale_fill_identity, scale_linetype_identity,

    scale_shape_identity, scale_size_identity)

    Use values without scaling.

    scale_manual (scale_alpha_manual, scale_color_manual, scale_colour_manual, scale_fill_manual, scale_linetype_manual,

    scale_shape_manual, scale_size_manual)

    Create your own discrete scale.

    scale_linetype (scale_linetype_continuous, scale_linetype_discrete)

    Scale for line patterns.

    scale_shape (scale_shape_continuous, scale_shape_discrete)

    Scale for shapes, aka glyphs.

    scale_size (scale_radius, scale_size_area, scale_size_continuous, scale_size_date, scale_size_datetime, scale_size_discrete)

    Scale size (area or radius).

    scale_x_discrete (scale_y_discrete)Discrete position.

    labs (ggtitle, xlab, ylab)

    Change axis labels and legend titles

    update_labels

    Update axis/legend labels

    converted by Web2PDFConvert.com

    http://www.web2pdfconvert.com/?ref=PDFhttp://www.web2pdfconvert.com/?ref=PDFhttp://docs.ggplot2.org/current/update_labels.htmlhttp://docs.ggplot2.org/current/labs.htmlhttp://docs.ggplot2.org/current/scale_discrete.htmlhttp://docs.ggplot2.org/current/scale_size.htmlhttp://docs.ggplot2.org/current/scale_shape.htmlhttp://docs.ggplot2.org/current/scale_linetype.htmlhttp://docs.ggplot2.org/current/scale_manual.htmlhttp://docs.ggplot2.org/current/scale_identity.htmlhttp://docs.ggplot2.org/current/scale_hue.htmlhttp://docs.ggplot2.org/current/scale_grey.htmlhttp://docs.ggplot2.org/current/scale_gradient.htmlhttp://docs.ggplot2.org/current/scale_brewer.htmlhttp://docs.ggplot2.org/current/scale_alpha.htmlhttp://docs.ggplot2.org/current/lims.htmlhttp://docs.ggplot2.org/current/guide_colourbar.htmlhttp://docs.ggplot2.org/current/guide_legend.htmlhttp://docs.ggplot2.org/current/guides.htmlhttp://docs.ggplot2.org/current/expand_limits.htmlhttp://docs.ggplot2.org/current/stat_unique.htmlhttp://docs.ggplot2.org/current/stat_summary_2d.htmlhttp://docs.ggplot2.org/current/stat_qq.htmlhttp://docs.ggplot2.org/current/stat_identity.htmlhttp://docs.ggplot2.org/current/stat_function.htmlhttp://docs.ggplot2.org/current/stat_ellipse.htmlhttp://docs.ggplot2.org/current/stat_ecdf.htmlhttp://docs.ggplot2.org/current/geom_violin.html
  • 7/26/2019 Docs Ggplot2 Org

    3/6

    Coordinate systemsCoordinate systems adjust the mapping from coordinates to the 2d plane of the computer screen.

    coord_cartesian

    Cartesian coordinates.

    coord_fixed (coord_equal)

    Cartesian coordinates with fixed relationship between x and y scales.

    coord_flip

    Flipped cartesian coordinates.

    coord_map (coord_quickmap)

    Map projections.

    coord_polar

    Polar coordinates.

    coord_trans

    Transformed cartesian coordinate system.

    FacetingFacets display subsets of the dataset in different panels.

    facet_grid

    Lay out panels in a grid.

    facet_null

    Facet specification: a single panel.

    facet_wrap

    Wrap a 1d ribbon of panels into 2d.

    labeller

    Generic labeller function for facets

    label_bquote

    Backquoted labeller

    Position adjustmentsPosition adjustments can be used to fine tune positioning of objects to achieve effects like dodging, jittering and stacking.

    position_dodge

    Adjust position by dodging overlaps to the side.

    position_fill (position_stack)Stack overlapping objects on top of one another.

    position_identity

    Don't adjust position

    position_nudge

    Nudge points.

    position_jitter

    Jitter points to avoid overplotting.

    position_jitterdodge

    Adjust position by simultaneously dodging and jittering

    Data

    Data sets included in ggplot2 and used in examplesdiamonds

    Prices of 50,000 round cut diamonds

    economics (economics_long)

    US economic time series.

    faithfuld

    2d density estimate of Old Faithful data

    luv_colours

    colors()

    midwest

    Midwest demographics.

    mpg

    Fuel economy data from 1999 and 2008 for 38 popular models of car

    msleep

    An updated and expanded version of the mammals sleep dataset.

    presidential

    Terms of 11 presidents from Eisenhower to Obama.

    converted by Web2PDFConvert.com

    http://www.web2pdfconvert.com/?ref=PDFhttp://www.web2pdfconvert.com/?ref=PDFhttp://docs.ggplot2.org/current/presidential.htmlhttp://docs.ggplot2.org/current/msleep.htmlhttp://docs.ggplot2.org/current/mpg.htmlhttp://docs.ggplot2.org/current/midwest.htmlhttp://docs.ggplot2.org/current/luv_colours.htmlhttp://docs.ggplot2.org/current/faithfuld.htmlhttp://docs.ggplot2.org/current/economics.htmlhttp://docs.ggplot2.org/current/diamonds.htmlhttp://docs.ggplot2.org/current/position_jitterdodge.htmlhttp://docs.ggplot2.org/current/position_jitter.htmlhttp://docs.ggplot2.org/current/position_nudge.htmlhttp://docs.ggplot2.org/current/position_identity.htmlhttp://docs.ggplot2.org/current/position_stack.htmlhttp://docs.ggplot2.org/current/position_dodge.htmlhttp://docs.ggplot2.org/current/label_bquote.htmlhttp://docs.ggplot2.org/current/labeller.htmlhttp://docs.ggplot2.org/current/facet_wrap.htmlhttp://docs.ggplot2.org/current/facet_null.htmlhttp://docs.ggplot2.org/current/facet_grid.htmlhttp://docs.ggplot2.org/current/coord_trans.htmlhttp://docs.ggplot2.org/current/coord_polar.htmlhttp://docs.ggplot2.org/current/coord_map.htmlhttp://docs.ggplot2.org/current/coord_flip.htmlhttp://docs.ggplot2.org/current/coord_fixed.htmlhttp://docs.ggplot2.org/current/coord_cartesian.html
  • 7/26/2019 Docs Ggplot2 Org

    4/6

  • 7/26/2019 Docs Ggplot2 Org

    5/6

    theme_update (theme_get, theme_replace, theme_set)

    Get, set and update themes.

    Plot creationggplot (ggplot.data.frame, ggplot.default)

    Create a new ggplot plot.

    qplot (quickplot)

    Quick plot

    +.gg (%+%, %+replace%)

    Add a new component to a ggplot or theme object.

    autoplot

    Create a complete ggplot appropriate to a particular data type

    is.ggplot

    Reports whether x is a ggplot object

    print.ggplot (plot.ggplot)

    Draw plot on current graphics device.

    Aestheticsaes

    Define aesthetic mappings.

    aes_ (aes_q, aes_string)

    Define aesthetic mappings from strings, or quoted calls and formulas.

    aes_all

    Given a character vector, create a set of identity mappings

    aes_auto

    Automatic aesthetic mapping

    aes_colour_fill_alpha (color, colour, fill)

    Colour related aesthetics: colour, fill and alpha

    aes_group_order (group)

    Aesthetics: group

    aes_linetype_size_shape (linetype, shape, size)

    Differentiation related aesthetics: linetype, size, shape

    aes_position (x, xend, xmax, xmin, y, yend, ymax, ymin)

    Position related aesthetics: x, y, xmin, xmax, ymin, ymax, xend, yend

    ggprotoggproto (ggproto_parent)

    Create a new ggproto object

    print.ggproto

    Print a ggproto object

    is.ggproto

    Is an object a ggproto object?

    format.ggproto

    Format a ggproto object

    Otheras_labeller

    Coerce to labeller function

    as.list.ggproto

    Convert a ggproto object to a list

    cut_interval (cut_number, cut_width)

    Cut up numeric vector into useful groups.

    geom_spoke (stat_spoke)

    A line segment parameterised by location, direction and distance.

    ggsave

    Save a ggplot (or other grid object) with sensible defaults

    graphical-units (.pt, .stroke)

    Graphical units

    hmisc (mean_cl_boot, mean_cl_normal, mean_sdl, median_hilow)

    Wrap up a selection of summary functions from Hmisc to make it easy to use

    labellers (label_both, label_context, label_parsed, label_value, label_wrap_gen)

    Labeller functions

    last_plot

    converted by Web2PDFConvert.com

    http://www.web2pdfconvert.com/?ref=PDFhttp://www.web2pdfconvert.com/?ref=PDFhttp://docs.ggplot2.org/current/last_plot.htmlhttp://docs.ggplot2.org/current/labellers.htmlhttp://docs.ggplot2.org/current/hmisc.htmlhttp://docs.ggplot2.org/current/graphical-units.htmlhttp://docs.ggplot2.org/current/ggsave.htmlhttp://docs.ggplot2.org/current/geom_spoke.htmlhttp://docs.ggplot2.org/current/cut_interval.htmlhttp://docs.ggplot2.org/current/as.list.ggproto.htmlhttp://docs.ggplot2.org/current/as_labeller.htmlhttp://docs.ggplot2.org/current/format.ggproto.htmlhttp://docs.ggplot2.org/current/is.ggproto.htmlhttp://docs.ggplot2.org/current/print.ggproto.htmlhttp://docs.ggplot2.org/current/ggproto.htmlhttp://docs.ggplot2.org/current/aes_position.htmlhttp://docs.ggplot2.org/current/aes_linetype_size_shape.htmlhttp://docs.ggplot2.org/current/aes_group_order.htmlhttp://docs.ggplot2.org/current/aes_colour_fill_alpha.htmlhttp://docs.ggplot2.org/current/aes_auto.htmlhttp://docs.ggplot2.org/current/aes_all.htmlhttp://docs.ggplot2.org/current/aes_.htmlhttp://docs.ggplot2.org/current/aes.htmlhttp://docs.ggplot2.org/current/print.ggplot.htmlhttp://docs.ggplot2.org/current/is.ggplot.htmlhttp://docs.ggplot2.org/current/autoplot.htmlhttp://docs.ggplot2.org/current/gg-add.htmlhttp://docs.ggplot2.org/current/qplot.htmlhttp://docs.ggplot2.org/current/ggplot.htmlhttp://docs.ggplot2.org/current/theme_update.html
  • 7/26/2019 Docs Ggplot2 Org

    6/6

    Back to top

    Retrieve the last plot to be modified or created.

    layer

    Create a new layer

    mean_se

    Calculate mean and standard errors on either side.

    resolution

    Compute the "resolution" of a data vector.

    scale_continuous (scale_x_continuous, scale_x_log10, scale_x_reverse, scale_x_sqrt, scale_y_continuous, scale_y_log10, scale_y_reverse,

    scale_y_sqrt)

    Continuous position scales (x & y).scale_date (scale_x_date, scale_x_datetime, scale_y_date, scale_y_datetime)

    Position scale, date & date times

    stat_summary_bin (stat_summary)

    Summarise y values at unique/binned x x.

    translate_qplot_ggplot

    Translating between qplot and ggplot

    translate_qplot_lattice

    Translating between qplot and lattice

    update_geom_defaults (update_stat_defaults)

    Modify geom/stat aesthetic defaults for future plots

    VignettesExtending ggplot2

    Aesthetic specifications

    DependenciesImports: digest, grid, gtable, MASS, plyr, reshape2, scales, stats

    Suggests: covr, ggplot2movies, hexbin, Hmisc, lattice, mapproj, maps, maptools, mgcv, multcomp, nlme, testthat, quantreg, knitr, rpart, rmarkdown,

    svglite

    AuthorsHadley Wickham[aut, cre]

    Winston Chang[aut]

    RStudio [cph]

    What do you think of the documentation? Please let me know by filling out this short online survey.

    Built by staticdocs. Styled with bootstrap.

    http://www.web2pdfconvert.com/?ref=PDFhttp://www.web2pdfconvert.com/?ref=PDFhttp://twitter.github.com/bootstraphttps://github.com/hadley/staticdocshttp://hadley.wufoo.com/forms/documentation-feedback/def/field0=mailto:[email protected]:[email protected]://docs.ggplot2.org/current/vignettes/ggplot2-specs.htmlhttp://docs.ggplot2.org/current/vignettes/extending-ggplot2.htmlhttp://docs.ggplot2.org/current/update_defaults.htmlhttp://docs.ggplot2.org/current/translate_qplot_lattice.htmlhttp://docs.ggplot2.org/current/translate_qplot_ggplot.htmlhttp://docs.ggplot2.org/current/stat_summary.htmlhttp://docs.ggplot2.org/current/scale_date.htmlhttp://docs.ggplot2.org/current/scale_continuous.htmlhttp://docs.ggplot2.org/current/resolution.htmlhttp://docs.ggplot2.org/current/mean_se.htmlhttp://docs.ggplot2.org/current/layer.html