printWithFootnote: Function printWithFootnote

Description Usage Arguments Value Author(s) Examples

View source: R/printAndSave.R

Description

Print a ggplot2 object to the console/knitr report adding footnote text under the plot. Use when you want the footnot to be underneath the plot labels. Only prints the footnote once on a facetted plot.

Usage

1
2
3
4
5
6
7
printWithFootnote(
  plotObject,
  footnote,
  fontface = "plain",
  fontsize = 10,
  hjust = -0.1
)

Arguments

plotObject

A ggplot2 plotobject

footnote

A path/filename for the graphic

fontface

fontface for the footnotw (default = "plain")

fontsize

size of the footnote font (default = 10)

hjust

Specify horizontal justification (Default = -0.1)

Value

Prints the graphic object to the console

Author(s)

John Thompson, jrt@thompsonclan.org

Examples

1
2
3
4
5
6
7
    #Write to the console or knitr report
    printWithFootnote(Myggplot, footnote = "Footnote Text")

    #Capture to a file
    png ("myplot.png", width=5, height=4, unit="in")
    printWithFootnote(Myggplot, footnote = "Footnote Text")
    invisible(dev.off())

jrthompson54/DGE.Tools2 documentation built on May 12, 2021, 8:47 p.m.