plotApa.Rd
Plots Aggregate Peak Analysis Matrix
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
)
optional "pgParams" object containing relevant function parameters
numeric or unit object specifying x-location of plot
numeric or unit object specifying y-location of plot
numeric or unit object specifying width of plot
numeric or unit object specifying height of plot
string or numeric vector specifying the justification of the viewport relative to its (x, y) location
string indicating the default units to use if x, y, width, or height are only given as numeric vectors
logical value indicating whether graphics output should be produced
colorRampPalette function to use to map values to colors
numeric by which to divide aggregate matrix
vector of length 2; max and min values to set color scale
matrix, list of matricies, or 3 column data.frame of APA results
Function will draw a APA matrix and return an object of class "apa"
## Create divergent matrix ####
m <- matrix(data = rnorm(n = 21*21, mean = 0, sd = 2), nrow = 21, ncol = 21)
## Define parameters
p <- pgParams(width = 3, height = 3, default.units = "inches")
#> Error in pgParams(width = 3, height = 3, default.units = "inches"): could not find function "pgParams"
## Create page
pageCreate(params = p)
#> Error in pageCreate(params = p): could not find function "pageCreate"
## Plot apa
plot <- 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)
#> Error in eval(expr, p): object 'p' not found
## Annotate legend
annoHeatmapLegend(plot = plot,
x = 2.3, y = 0.75, width = 0.1, height = 0.75)
#> Error in annoHeatmapLegend(plot = plot, x = 2.3, y = 0.75, width = 0.1, height = 0.75): could not find function "annoHeatmapLegend"
## Create sequential matrix
m <- matrix(data = sample(0:100, 21*21, replace = T), nrow = 21, ncol = 21)
## Define parameters
p <- pgParams(width = 3, height = 3, default.units = "inches")
#> Error in pgParams(width = 3, height = 3, default.units = "inches"): could not find function "pgParams"
## Create page
pageCreate(params = p)
#> Error in pageCreate(params = p): could not find function "pageCreate"
## Plot apa
plot <- 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)
#> Error in eval(expr, p): object 'p' not found
## Annotate legend
annoHeatmapLegend(plot = plot,
x = 2.3, y = 0.75, width = 0.1, height = 0.75)
#> Error in annoHeatmapLegend(plot = plot, x = 2.3, y = 0.75, width = 0.1, height = 0.75): could not find function "annoHeatmapLegend"