getBackgroundStyle: Return a background style for plotting functions

Description Usage Arguments Value Examples

View source: R/visualizeResults.R

Description

Given a string corresponding to a background style, returns a matching ggplot2 function that can be used by PeakMapper's plotting functions to create plots with the specified background style. If the supplied string is not one of either "grey", "blackAndWhite", or "minimal", the ggplot2 function corresponding to the "blackAndWhite" style will be returned. Note that this is a helper function for PeakMapper's various plotting functions and should NOT be called directly by the user.

Usage

1
getBackgroundStyle(background)

Arguments

background

The style of the plot background. This must be one of either "grey" (for a grey-panelled background), "blackAndWhite" (for a white-panelled background), or "minimal" (for a background with no panelling). Otherwise, the background style corresponding to "blackAndWhite" will be returned

Value

A ggplot2 theme function to be used by one of PeakMapper's plotting functions to determine the background layout. This function is either theme_grey() (if "grey" is input), theme_bw() (if "blackAndWhite" is input, or the user does not provide a valid input), or theme_classic() (if "minimal" is input)

Examples

1
2
3
4
5
6
7
## Not run: 
  mappingResult <- mapPeaks(H3K27me3Peaks, WS263Genes)
  backgroundStyle <- getBackgroundStyle("grey")
  ggplot2::ggplot() + backgroundStyle +
       ggplot2::geom_bar(aes(as.factor(mappingResult$Peak_Position)))

## End(Not run)

fuscada2/PeakMapper documentation built on Dec. 8, 2019, 12:35 p.m.