editor_options: markdown: wrap: 72
compute_just() to work with any value
angle aesthetic, as in the accepted version of the pull
request in 'ggplot2'.
Fix bug in
geom_table() that would cause text left or right justified
to be clipped when the text in a cell was very long. (Cell padding still
This new package is the result of splitting package 'ggpmisc' into two packages: 'ggpp' containing extensions to the grammar of graphics and 'ggpmisc' containing extensions to 'ggplot2' related to plot decorations based on model fits, statistical summaries and other descriptors of the data being plotted. Package 'ggpmisc' depends on 'ggpp' with no visible changes for users. Package 'ggpp' can be loaded instead of 'ggpmisc' when only the extensions it contains are needed. Package 'gginnards' containing tools for editing ggplot objects as well as tools for inspecting them is an earlier spin-off from 'gpmisc'.
Compared to 'ggpmisc' 0.3.9, the following changes have been introduced.
New justification styles have being implemented to complement
position_nudge_center() . They are supported in
In the current implementation all rows in
data should contain the same
vjust value when using the new types of justification
described here, this seems reasonable as they compute the individual
justification values from the data. All other justification values,
character do not have this restriction and can be
used as in geoms from 'ggplot2'. These new features may change in the
"inward_median"so that outward and inward are with respect to the centroid of the data instead of to the middle of the $x$ or $y$ scales. This should be useful in combination with
"inward_nnn"so that outward and inward are with respect to the number resulting from applying
as.numeric()to the characters that replace
nnn. For example strings like
"outward_-3e-2"are supported. This should be useful when manual tweaking is desired. As special cases
"inward_0"apply justification outward and inward with respect to the origin. This should be useful for biplots used for PCA and similar cases with arrows radiating out of the origin. (The
"inward"justification implemented in 'ggplot2' is relative to the middle of the $x$ or $y$ scales.)
compute_npcy()to support multiple steps per group (needed in 'ggpmisc').
"inward"justification of text labels when
angleaesthetic takes values \< -45 or > 45 degrees. This code change alters how old plots are rendered if text labels have been rotated by more than 45 degrees.
ggplot2::geom_text()has been submitted and merged. This is now in the 'ggplot2' 3.3.4 milestone retaining consistent behaviour between 'ggplot2', 'ggrepel', 'ggpp' and 'ggpmisc'.
geom_linked_text(). Except for the drawing of segments or arrows this new geometry behaves as
ggplot2::geom_text(). Note: Segments and arrows are drawn only if the position function used returns both the repositioned and original coordinates.
position_nudge_line()compute the direction of nudging and return both the nudged and original positions.
position_nudge_to()nudges to new user-supplied position(s);
position_nudge_keep()nudges to position(s) based on user-supplied position shift. These functions return both nudged and original position(s), which makes possible to draw connecting segments from text labels to the original position.
stat_fit_tb()now import the tidiers from package 'generics' instead of from 'broom'. As a result, users must now explicitly load the package where the methods to be used are defined, such as 'broom' or 'broom.mixed' or define them before calling these statistics.
stat_fit_augment()as some specializations of
stat_fit_augment()accept arguments specific to a given fitting method.
stat_fit_tidy()would fail with
quantreg::rq()and any other fit methods that do not return by default standard error estimates for parameter estimates (Thanks to Mark Neal for reporting the problem).
stat_fit_tidy()to ensure compatibility with
cor.test()and other functions that require an object rather than a quoted expression as argument for
try_data_frame()did not handle correctly the conversion of dates for some time series, which also could affect
stat_valleys()generated wrong labels if a
Dateobject was mapped to x (the bug did not affect POSIX or datetime, and was obvious as it resulted in a shift in dates by several decades).
stat_fit_tb()to support renaming of terms/parameter names in the table (Suggested by Big Old Dave and Z. Lin). In addition implement selection, reordering and renaming of columns and terms/parameters using positional indexes and pattern matching of truncated names in addition to whole names. Improve formatting of small P-values.
stat_fmt_tb()to support the same expanded syntax as
stat_dens1d_labels(), to complement existing
stat_dens2d_labels()adding formal parameters
invert.selection, as available in the new 1D versions.
stat_dens2d_labels()to accept not only character strings but also functions as argument to
label.fillas the new
ggplot2::annotate()adding support for aesthetics
stat_poly_eq()to support labeling of equations according to group.
geom_richtext()from package 'ggtext'.
This version implements some new features and fixes bugs in the features introduced in version 0.3.1, please do rise an issue if you notice any remaining bugs! Some reported weaknesses in the documentation have been addressed. This updated version depends on 'ggplot2' (>= 3.2.1).
Add support for volcano and quadrant plots of outcomes.
Add convenience scales
data expressed as fold change.
Add convenience scales
Add convenience scales
scale_shape_outcome() for data
expressed as ternary or binary outcomes.
Add conversion functions
to convert vectors of numeric outcomes into factors with 2 or 3
Add conversion function
xy_thresholds2factor() to combine two vectors of numeric outcomes
into a 4-level factor.
Improve support for model-fit annotations.
stat_poly_eq() so that optionally instead of text labels it
can return numeric values extracted from the fit object.
Document with examples how to pass weights and covariates to
statistics based on methods from package 'broom'. Highlight the
stat_poly_eq() and the
statistics implemented using package 'broom'.
stat_apply_fun() to allow simultaneous application of
functions to x and y aesthetics, and handling of
other functions returning slightly shorter vectors than their input.
stat_fit_glance() the use of character strings as position
arguments for parameters
label.y when using geoms
based on x and y aesthetics in addition to when using those
This is a major update, with a few cases in which old code may need to be revised to work, and many cases in which there will be subtle differences in the positions of labels used as annotations. The many new features may still have some bugs, please do rise an issue if you notice one!
Version requiring 'ggplot2' (>= 3.1.0).
Add new geometries, several of them accepting x and y in npc units
through the new aesthetics
npcy, allowing positioning
relative to plotting area irrespective of native data units and scale
limits. These geometries are useful on their own for annotations in
particular they allow consistent positioning of textual summaries. By
default they do not inherit the plot's aesthetic mappings making their
behaviour remain by default in-between that of true geometries and that
geom_label_npc()using aesthetics npcx and npcy.
geom_table_npc()using aesthetics npcx and npcy.
geom_plot_npc()which can be used to add inset plots to a ggplot.
geom_grob_npc()which can be used to add inset grobs to a ggplot.
geom_y_margin_arrow()which behave similarly to
geom_vline()but plot points or arrows instead of lines. Add
geom_y_margin_grob()with similar behaviour but for adding grobs.
geom_table()and depended on the old default of
stat_fit_glance()and improve diagnosis of unsupported input. Replace bad example in the corresponding documentation (workaround for bug reported by Robert White).
Version requiring 'ggplot2' (>= 3.0.0), now in CRAN. Low level manipulation and debug methods and functions moved to new package 'gginnards' available through CRAN.
stat_poly_eq()(fixing bug reported by S.Al-Khalidi).
stat_fmt_tb()for formatting of tibbles for addition to plots as tables.
Non-CRAN version with additional functionality, but requiring the development version of 'ggplot2'.
Non-CRAN version with additional functionality, but requiring the development version of 'ggplot2' >= 22.214.171.12400 (>= commit of 2017-02-09) from Github. Visit
geom_table(), a geom for adding a layer containing one or more tables to a plot panel.
stat_fit_tb()a stat that computes a tidy tabular version of the summary or ANOVA table from a model fit.
stat_quadrat_count() a stat that computes the number of
observations in each quadrant of a plot panel ignoring grouping.
Fix bugs, one of which is code breaking: the names of returned
parameter estimates have changed in
stat_fit_tidy() now pasting
"_estimate" to avoid name clashes with mapped variables.
stat_fit_tidy()so that it returns p-values for parameters, in addition to estimates and their standard errors.
geom_debug()adding missing default arguments.
stat_fit_tidy() implemented using
broom::tidy(). Makes it
possible to add the fitted equation for any fitted model supported by
package 'broom', as long as the user supplies within aes() the code to
build a label string. Update user guide.
Fix bug in
eq.x.rhs argument ignored when using
try_data_frame()which made them fail silently with some objects of class
"ts"in the case of numeric (decimal date) index for time. In addition lack of special handling for classes
"yearqrt"from package 'zoo', lead to erroneous date shifts by a few days.
stat_dens2d_labels(), a statistic that resets label values to
NA by default, or any character string supplied as argument, in
regions of a panel with high density of observations.
stat_den2d_filter(), a statistic that filters-out/filters-in
observations in regions of a panel with high density of
observations. These two statistics are useful for labeling or
highlighting observations in regions of a panel with low density.
Both stats use a compute_panel function.
stat_den2d_filter_g(), a statistic that filters-out/filters-in
observations in regions of a group with high density of
observations. This statistics is useful for highlighting
observations. It uses a compute_group function. They use internally
MASS:kde2d to estimate densities and default values for parameters
are adjusted dynamically based on the number of observations.
try_data_frame()to return an object of class
stat_poly_eq() so that 1) position of labels according to
npc (relative positions using normalized coordinates), as well as
by named positions
"center" is now implemented; 2) when grouping is present, suitable
vjust values are computed to automatically position the labels for
the different groups without overlap. Default label positions are
now relative to the range of each panel's $x$ and $y$ scales,
eliminating in most cases the need to manually tweak label
stat_fit_glance() uses package 'broom' for maximum flexibility
in model function choice when wanting to add labels based on
information from a model fit, at the expense of very frequently
having to explicitly set aesthetics, and always having to add code
to do the formatting of the values to be used in labels. Label
position is as described above for
stat_fit_deviations() for highlighting residuals in plots of
fitted models. This statistic currently supports only
By default geom "segment" is used to highlight the deviations of the
observations from a fitted model.
stat_fit_residuals() for plotting residuals from a fitted
model on their own in plots matching plots of lm fits plotted with
stat_smooth() even with grouping or facets. This statistic currently
lm() fits. By default geom "point" is used to plot
the residual from a fitted model.
Add preliminary version of
stat_fit_augment(), which uses package
'broom' for maximum flexibility in model function choice, to augment
the data with additional columns of values derived from a model fit.
stat_debug_panel()and stat_debug_group() so that they can optionally print to the console a summary of the data received as input.
geom_debug(), a geom that summarizes its data input to the console, and produces no visible graphical output.
stat_poly_eq()changed to include the lhs (left hand side) of the equation by default.
Add function try_data_frame() to convert R objects including time
series objects of all classes accepted by
try.xts() into data
frames suitable for plotting with
stat_valleys() to work correctly when
the x aesthetic uses a
Datetime continuous scale such as
ggplot() sets automatically for
POSIXct variables mapped to the
stat_valleys()(these are simpler versions of
ggspectra::stat_valleys()for use with any numerical data (rather than light spectra).
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.