bb_plotApa.Rd
Plots Aggregate Peak Analysis Matrix
bb_plotApa( params = NULL, apa, x = NULL, y = NULL, width = NULL, height = NULL, just = c("left", "top"), default.units = "inches", draw = TRUE, palette = colorRampPalette(c("white", "dark red")), n = NULL, zrange = NULL )
params | optional "bb_params" object containing relevant function parameters |
---|---|
apa | matrix, list of matricies, or 3 column data.frame of APA results |
x | numeric or unit object specifying x-location of plot |
y | numeric or unit object specifying y-location of plot |
width | numeric or unit object specifying width of plot |
height | numeric or unit object specifying height of plot |
just | string or numeric vector specifying the justification of the viewport relative to its (x, y) location |
default.units | string indicating the default units to use if x, y, width, or height are only given as numeric vectors |
draw | logical value indicating whether graphics output should be produced |
palette | colorRampPalette function to use to map values to colors |
n | numeric by which to divide aggregate matrix |
zrange | vector of length 2; max and min values to set color scale |
Function will draw a APA matrix and return an object of class "bb_apa"
## Create divergent matrix #### m <- matrix(data = rnorm(n = 21*21, mean = 0, sd = 2), nrow = 21, ncol = 21) ## Define parameters p <- bb_params(width = 3, height = 3, default.units = "inches") ## Create page bb_pageCreate(params = p) ## Plot apa plot <- bb_plotApa(apa = m, x = p$width/2, y = p$height/2, width = p$width*0.5, height = p$width*0.5, just = c("center", "center"), palette = colorRampPalette(c("blue", "white", "red")), zrange = NULL) ## Annotate legend bb_annoHeatmapLegend(plot = plot, x = 2.3, y = 0.75, width = 0.1, height = 0.75) ## Create sequential matrix m <- matrix(data = sample(0:100, 21*21, replace = T), nrow = 21, ncol = 21) ## Define parameters p <- bb_params(width = 3, height = 3, default.units = "inches") ## Create page bb_pageCreate(params = p) ## Plot apa plot <- bb_plotApa(apa = m, x = p$width/2, y = p$height/2, width = p$width*0.5, height = p$width*0.5, just = c("center", "center"), palette = colorRampPalette(c("white", "dark red")), zrange = NULL) ## Annotate legend bb_annoHeatmapLegend(plot = plot, x = 2.3, y = 0.75, width = 0.1, height = 0.75)