ggpubr 0.4.0 2020-06-27

New features

  • New functions added to customize ggtexttable() (#125, #129 and #283):
    • tab_cell_crossout(): cross out a table cell.
    • tab_ncol(), tab_nrow(): returns, respectively, the number of columns and rows in a ggtexttable.
    • tab_add_hline(): Creates horizontal lines or separators at the top or the bottom side of a given specified row.
    • tab_add_vline(): Creates vertical lines or separators at the right or the left side of a given specified column.
    • tab_add_border(), tbody_add_border(), thead_add_border(): Add borders to table; tbody is for table body and thead is for table head.
    • tab_add_title() and tab_add_footnote() to add titles and footnotes (#243).
  • ggpubr functions updated to handle non-standard column names, for example (“A-A”) (#229).
  • New function create_aes() added to create aes mapping from a list. Makes programming easy with ggplot2 (#229).
  • New argument coord.flip added to support adding p-values onto horizontal ggplots (#179). When adding the p-values to a horizontal ggplot (generated using coord_flip()), you need to specify the option coord.flip = TRUE.
  • New errorbar functions - median_hilow_() and median_q1q3() - added (@davidlorenz, #209):
    • median_hilow_(): computes the sample median and a selected pair of outer quantiles having equal tail areas. This function is a reformatted version of Hmisc::smedian.hilow(). The confidence limits are computed as follow: lower.limits = (1-ci)/2 percentiles; upper.limits = (1+ci)/2 percentiles. By default (ci = 0.95), the 2.5th and the 97.5th percentiles are used as the lower and the upper confidence limits, respectively. If you want to use the 25th and the 75th percentiles as the confidence limits, then specify ci = 0.5 or use the function median_q1q3().
    • median_q1q3(): computes the sample median and, the 25th and 75th percentiles. Wrapper around the function median_hilow_() using ci = 0.5.
  • New function get_breaks() added to easily create breaks for numeric axes. Can be used to increase the number of x and y ticks by specifying the option n. It’s also possible to control axis breaks by specifying a step between ticks. For example, if by = 5, a tick mark is shown on every 5 (@Chitanda-Satou, #258).

Major changes

  • The following enhancement has been added to ggscatterhist() (@juliechevalier, #176):
    • the output of ggscatterhist() is now a list of ggplots, containing the main scatter plot (sp) and the marginal plots (xplot and yplot), which can be customized by the end user using the standard ggplot verbs
    • An S3 printing method is now available for an object of class ggscatterhist. The printing method displays the arranged final figure.

Minor changes

  • Now, when creating a box plot with error bars, color and fill argiments are taken into account in the errorbar function (#105).
  • New argument alternative supported in stat_cor() (#276).
  • New argument position in ggline() to make position “dodged” (#52).
  • New argument outlier.shape in ggboxplot(). Default is 19. To hide outlier, specify outlier.shape = NA. When jitter is added, then outliers will be automatically hidden.
  • Sorting can be now disabled in ggdotchart() using the option sorting = "none" (#115, #223).
  • New argument weight added in gghistogram() for creating a weighted histogram (#215)
  • Now ggscaterhist() takes into account the argument position in margin.params when marginal plot is a histogram (#286).
  • ggbarplot() enhanced to better handle the creation of dodged bar plots combined with jitter points (@aherholt, #176)
  • New argument bracket.shorten added in stat_pvalue_manual() and geom_bracket(). a small numeric value in [0-1] for shortening the with of bracket (#285).
  • New argument bracket.nudge.y added in stat_pvalue_manual() and geom_bracket(). Vertical adjustment to nudge brackets by. Useful to move up or move down the bracket. If positive value, brackets will be moved up; if negative value, brackets are moved down (#281).
  • New argument numeric.x.axis added in ggerrorplot(); logical value, If TRUE, x axis will be treated as numeric. Default is FALSE (#280).
  • The option width is now considered in ggadd() for plotting error bars (#278).
  • New argument linetype in ggpaired().
  • geom_exec() used in ggpaired() to add lines between paired points.
  • ggmaplot() now supports two input formats (#198):
    1. baseMean | log2FoldChange|padj: Here, we’ll use log2(baseMean) as the x-axis variable
    2. baseMeanLog2 | log2FoldChange|padj: here, baseMeanLog2 is assumed to be the mean of logged values; so we’ll use it as x-axis variable without any transformation.
  • new arguments added in ggmaplot():
  • In ggadd() the fill argument is considered for jitter points only when the point shape is in 21:25 (@atakanekiz, #148).
  • New argument parse added in ggscatter() and in ggtext(). If TRUE, the labels will be parsed into expressions and displayed as described in ?plotmath (#250).
  • New argument stroke supported in ggscatter() and in ggline(). Used only for shapes 21-24 to control the thickness of points border (@bioguy2018, #258).
  • the stat_cor() function code has been simplified. New arguments p.accuracy and r.accuracy added; a real value specifying the number of decimal places of precision for the p-value and the correlation coefficient, respectively. Default is NULL. Use (e.g.) 0.01 to show 2 decimal places of precision (@garthtarr, #186, @raedevan6, #114, #270).

Bug fixes

ggpubr 0.3.0 2020-05-04

New features

Minor changes

  • New arguments:
    • vjsut in stat_compare_means() to move the text up or down relative to the bracket.
    • type in geom_bracket() to specify label type. Can be “text” or “expression” (for parsing plotmath expression); #253.
    • labeller to the function facet()
    • position in get_legend() to specify legend position
    • legend.grob in ggarrange() to specify a common legend you want to add onto the combined plot.
  • Maintenance adaptation to dplyr new version by removing deprecated functions, such as group_by_, select_, arrange_, etc

Bug fixes

  • Now, Barplots are correctly labelled when custom labels are specified by users (@sekharcu, #234)

ggpubr 0.2.5 2020-02-13

Minor changes

  • New arguments cor.coef.name in the function stat_cor(). Can be one of “R” (pearson coef), “rho” (spearman coef) and “tau” (kendall coef). Uppercase and lowercase are allowed (@andhamel, #216).
  • New arguments digits, r.digits, p.digits in the function stat_cor(). Integer indicating the number of decimal places (round) or significant digits (signif) to be used for the correlation coefficient and the p-value (@raedevan6, #216).
  • compare_means() adapted to tidyr v>= 1.0.0 by specifying cols in the unnest() function (@Youguang, #216).

ggpubr 0.2.4 2019-11-14

Minor change

  • unnest adapted to tidyr 1.0.0
  • stat_pvalue_manual() can now handle an rstatix test result containing only one group column.

ggpubr 0.2.3 2019-09-03

New features

  • New function stat_central_tendency() to add central tendency measures (mean, median, mode) to density and histogram plots
  • New function stat_overlay_normal_density() to overlay normal density plot (with the same mean and SD) to the density distribution of ‘x’.

Minor changes

Bug fixes

ggpubr 0.2.2 2019-08-07

New fatures

  • New function geom_bracket() for adding brackets with label annotation to a ggplot. Helpers for adding p-value or significance levels to a plot.

Minor changes

Bug fixes

  • Bug fixes in gghistogram(). Works now when the x variable is R keyword, such as var, mean, etc. (#192)
  • In ggline(), error bars now react automatically to grouping by line type (#191)

ggpubr 0.2.1 2019-06-23

Minor changes

Bug fixes

ggpubr 0.2 2018-11-15

Bug fixes

  • P-value for multiple comparisons by group (stat_compare_means()) are now correctly displayed (@elisheva100, #135).

ggpubr 0.1.9 2018-11-11

Minor changes

  • ggsci palettes have been updated to add new palettes: nejm, jama, ucscgb, d3, locuszoom, igv, startrek, tron, futurama, simpsons (@cbrueffer, #118

Bug fixes

  • The option ref.group was only considered when the grouping variable contains more than two levels. In that case, each level is compared against the specified reference group. Now, ref.group option is also considereded in two samples mean comparisons (@OwenDonohoe, #118)

  • Now, ggqqplot() reacts to the argument conf.int.level (@vsluydts, #123
  • Added error bar color is now inherited from the main plot (@JesseRop, #109

ggpubr 0.1.8 2018-08-30

New features

Minor changes

Bug fixes

ggpubr 0.1.7 2018-06-23

New features

Minor changes

Bug fixes

  • In ggscatterhist() the x variable was plotted two times, on both the plot x & y margins, instead of having, as expected, a) the x variable on the main plot x margin and 2) the y variable on the main plot y margin. This has been now fixed.
  • In previous version, ggdotchart() sorted automatically within groups when the color argument is specified, even when groups = NULL. This default behaviour has been now removed. Sorting withi groups is performed only when the argument group is specified (@sfeds, #90).
  • Now, yticks.by and xticks.by work with NAs (@j3ypi, #89).

ggpubr 0.1.6 2017-11-14

New features

  • New function ggballoonplot() added to visualize a contingency table.

  • ggdotchart() can be now used to plot multiple groups with position = position_dodge() (@ManuelSpinola, #45).

  • New function ggscatterhist() to create a scatter plot with marginal histograms, density plots and box plots.

  • New theme theme_pubclean(): a clean theme without axis lines, to direct more attention to the data.

  • New arguments in ggarrange() to customize plot labels (@G-Thomson, #41):
    • font.label
    • label.x and label.y
    • hjust and vjust
  • New argument method.args added to stat_compare_means(). A list of additional arguments used for the test method. For example one might use method.args = list(alternative = “greater”) for wilcoxon test (@Nicktz, #41).

  • New argument symnum.args added to stat_compare_means(). A list of arguments to pass to the function symnum for symbolic number coding of p-values. For example, symnum.args <- list(cutpoints = c(0, 0.0001, 0.001, 0.01, 0.05, 1), symbols = c("****", "***", "**", "*", "ns"))

  • New functions table_cell_font() and table_cell_bg() to easily access and change the text font and the background of ggtexttable() cells (@ProbleMaker, #29).

  • New argument numeric.x.axis in ggline(). logical. If TRUE, x axis will be treated as numeric. Default is FALSE. (@mdphan, #35)

  • New argument lab.nb.digits in ggbarplot(). Integer indicating the number of decimal places (round) to be used (#28). Example: lab.nb.digits = 2.

  • New argument tip.length in stat_compare_means(). Numeric vector with the fraction of total height that the bar goes down to indicate the precise column. Default is 0.03. Can be of same length as the number of comparisons to adjust specifically the tip lenth of each comparison. For example tip.length = c(0.01, 0.03).

Minor changes

  • Now get_legend() returns NULL when the plot doesn’t have legend.

Bug fixes

ggpubr 0.1.5 2017-08-22

Minor changes

  • In ggpar(), now legend.title can be either a character vector, e.g.: legend.title = “Species” or a list, legend.title = list(color = "Species", linetype = "Species", shape = "Species").

  • New argument ellipse.border.remove in ggscatter() to remove ellipse border lines.

ggscatter(mtcars, x = "mpg", y = "wt",
          color = "cyl",
          ellipse = TRUE, mean.point = TRUE,
          ellipse.border.remove = TRUE)

Bug fixes

ggpubr 0.1.4 2017-06-28

New features

Minor changes

  • In gghistogram(), density curve and rug react to the fill color.
  • ggarrange():
    • New argument àlign to specify whether graphs in the grid should be horizontally (“h”) or vertically (“v”) aligned.
    • New argument legend to remove or specify the legend position when arranging multiple plots.
    • New argument common.legend to create a common unique legend for multiple plots.

ggpubr 0.1.3 2017-06-06

New features

Major changes

  • New arguments in ggpubr functions, see ggboxplot(), ggdotplot(), ggstripchart(), ggviolin(), ggbarplot() and ggline:
    • combine added to combine multiple y variables on the same graph.
    • merge to merge multiple y variables in the same ploting area.
    • select to select which item to display.
    • remove to remove a specific item from a plot.
    • order to order plot items.
    • label, font.label, label.select, repel, label.rectangle to add and customize labels
    • facet.by, panel.labs and short.panel.labs: support for faceting and customization of plot panels
  • New argument grouping.vars in ggtext(). Grouping variables to sort the data by, when the user wants to display the top n up/down labels.

  • New arguments in theme_pubr():
    • border,
    • margin,
    • legend,
    • x.text.angle

Minor changes

  • Now, the argument palette Can be also a numeric vector of length(groups); in this case a basic color palette is created using the function grDevices::palette().

ggpubr 0.1.2 2017-03-14

New features

  • New function get_palette() to generate a palette of k colors from ggsci palettes, RColorbrewer palettes and custom color palettes. Useful to extend RColorBrewer and ggsci to support more colors.

Minor changes

  • Now the ggpar() function can handle a list of ggplots.
  • Now the default legend position is right.
  • New argument show.legend.text in the ggscatter() function. Use show.legend.text = FALSE to hide text in the legend.
  • New arguments title, submain, subtitle, caption, font.submain, font.subtitle, font.caption in the ggpar() function.
  • New argument font.family in ggscatter().

Bug fixed

  • The mean within group for ggdensity (gghistogram) are now shown if data have NA values @chunkaowang, #1

ggpubr 0.1.1 2016-12-05

New features

  • New function ggtext() for textual annotation.
  • New argument star.plot in ggscatter(). A logical value. If TRUE, a star plot is generated.
  • New helper function geom_exec(). A helper function used by ggpubr functions to execute any geom_xx functions in ggplot2. Useful only when you want to call a geom_xx function without carrying about the arguments to put in ggplot2::aes().
  • New arguments sort.val and top in ggbarplot().
    • sort.val: a string specifying whether the value should be sorted. Allowed values are “none” (no sorting), “asc” (for ascending) or “desc” (for descending).
    • top: a numeric value specifying the number of top elements to be shown.
  • New function theme_classic2() added. Classic theme with axis lines.

Minor changes

# Example
ggboxplot(iris$Sepal.Length)
  • Now, in gghistogram(), when add_density = TRUE, y scale remains = “..count..”.
  • Now, default theme changed to theme_classic2()
  • Default point size and line size set to NULL

ggpubr 0.1.0 2016-07-20

Plot one variable - X: Continuous

  • ggdensity(): Density plot
  • gghistogram(): Histogram plot
  • ggecdf(): Empirical cumulative density function
  • ggqqplot(): QQ plots

Plot two variables - X & Y: Discrete X and Continuous Y

  • ggboxplot(): Box plot
  • ggviolin(): Violin plot
  • ggdotplot(): Dot plot
  • ggstripchart(): Stripchart (jitter)
  • ggbarplot(): Bar plot
  • ggline(): Line plot
  • ggerrorplot(): Error plot
  • ggpie(): Pie chart
  • ggdotchart(): Cleveland’s dot plots

Plot two continuous variables

  • ggscatter(): Scatter plot

Graphical paramters

  • ggpar(): Change graphical parameters
  • show_line_type(): Line types available in R
  • show_point_shapes(): Point shapes available in R
  • theme_pubr(): Create a publication ready theme
  • labs_pubr(): Format only plot labels to a publication ready style

Genomics

  • ggmaplot(): MA-plot from means and log fold changes

Data

  • diff_express: Differential gene expression analysis results

Other

  • desc_statby(): Descriptive statistics by groups
  • stat_chull(): Plot convex hull of a set of points
  • stat_conf_ellipse(): Plot confidence ellipses
  • stat_mean(): Draw group mean points