waffle_iron: Make a waffle plot

Description Usage Arguments Value Examples

View source: R/waffle_iron.R

Description

Make a waffle plot from a data frame containing columns for fraction and subcellular localization.

Usage

1
2
3
4
5
6
7
8
9
waffle_iron(
  df,
  savePDF = FALSE,
  outputDir = getwd(),
  outputPrefix = format(Sys.time(), "%Y%m%d_%H%M%S"),
  fraction_colname = "fraction",
  waffleType = "Protein",
  fontFamily = "sans"
)

Arguments

df

A data frame containing columns for fraction and subcellular localization counts.

savePDF

Boolean value, controls whether to save PDF output to outputDir. Defaults to FALSE.

outputDir

Directory to save PDF output. Defaults to R working directory.

outputPrefix

String to use to prepend heatmap output filenames. Defaults to date and time.

fraction_colname

Name of data frame column containing fractions. Defaults to 'fraction'.

waffleType

Type of Waffle plot to make. This only affects the axis titles and filename. Typical values are "Protein" or "Proteoform". Defaults to "Protein".

fontFamily

Font family to use for plot. Defaults to "sans".

Value

A waffle plot (ggplot object)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
df <-
   data.frame(
      "fraction" =
         c(1,2,3,4,5,6),
      "Cytosol" =
         c(20,25,30,30,20,10),
      "Membrane" =
         c(15,10,20,25,10,5)
   )

   waffle_iron(
      df
   )

davidsbutcher/viztools documentation built on Oct. 5, 2020, 3:25 a.m.