Skip to contents

Package overview

ggpp ggpp-package
ggpp: Grammar Extensions to 'ggplot2'

Scales

Scales control de mapping of values in data to values of an aesthetic, or the propeerties of the plot’s graphic elements.

scale_npcx_continuous() scale_npcy_continuous()
Position scales for continuous data (npcx & npcy)
compute_npcx() compute_npcy() as_npcx() as_npcy() compute_npc() as_npc()
Compute NPC coordinates

Geoms

Geoms, short for geometric objects, describe the type of plot you will produce. They add a plot layer containing graphic elements representing values in the data,

annotate()
Annotations supporting NPC
geom_label_npc() geom_text_npc()
Text with Normalised Parent Coordinates
geom_label_s() geom_text_s()
Linked Text
geom_label_pairwise() geom_text_pairwise()
Label pairwise comparisons
geom_point_s()
Points linked by a segment
geom_x_margin_point() geom_y_margin_point()
Reference points on the margins
geom_x_margin_arrow() geom_y_margin_arrow()
Reference arrows on the margins
geom_x_margin_grob() geom_y_margin_grob()
Add Grobs on the margins
geom_quadrant_lines() geom_vhlines()
Reference lines: horizontal plus vertical, and quadrants
geom_plot() geom_plot_npc()
Inset plots
geom_grob() geom_grob_npc()
Inset graphical objects
geom_table() geom_table_npc()
Inset tables
ttheme_gtdefault() ttheme_gtminimal() ttheme_gtbw() ttheme_gtplain() ttheme_gtdark() ttheme_gtlight() ttheme_gtsimple() ttheme_gtstripes()
Table themes
ttheme_set()
Set default table theme

Statistics

It is often useful to summarize data before plotting, e.g., fiting models or computing means, or modifying the data in some other way.

stat_dens1d_filter() stat_dens1d_filter_g()
Filter observations by local 1D density
stat_dens1d_labels()
Replace labels in data based on 1D density
stat_dens2d_filter() stat_dens2d_filter_g()
Filter observations by local 2D density
stat_dens2d_labels()
Replace labels in data based on 2D density
stat_quadrant_counts()
Number of observations in quadrants
stat_panel_counts() stat_group_counts()
Number of observations in a plot panel
stat_fmt_tb()
Select and slice a tibble nested in data
stat_apply_group() stat_summary_xy() stat_centroid()
Apply a function to x or y values
stat_functions()
Draw functions as curves

Positions

It is often useful to displace plot elements away from their original positions to obtain stacked, side-by-side or non-overlapping plot elements.

position_nudge_keep()
Nudge points a fixed distance
position_nudge_to()
Nudge labels to new positions
position_nudge_center() position_nudge_centre()
Nudge labels away from a central point
position_nudge_line()
Nudge labels away from a line
position_dodgenudge() position_dodge_keep() position_dodge2_keep() position_dodge2nudge()
Combined positions dodge and nudge
position_stacknudge() position_fillnudge() position_stack_keep() position_fill_keep() position_stack_minmax()
Combined positions stack and nudge
position_jitternudge() position_jitter_keep()
Combined positions jitter and nudge

Plot creation

Additional ggplot methods for specific classes of data objects.

ggplot(<ts>) ggplot(<xts>)
Create a new ggplot plot from time series data

Helper functions

Additional functions that can be useful when creating plots.

dark_or_light()
Chose between dark and light color
try_data_frame() try_tibble()
Convert an R object into a tibble
wrap_labels()
Wrap character strings in a vector

Example data

Data sets as R objects. The data are used for examples in the documentation.

birch.df birch_dw.df
Birch seedlings' size
ivy.df
Ivy photosynthesis light response
quadrant_example.df
Gene expression data
volcano_example.df
Gene expression data
weather_18_june_2019.df
Weather data