plotPAMcorr: plotPAMcorr - Function for plotting of PAM correction.

Description Usage Arguments Value Note Author(s) Examples

View source: R/plotPAMcorr.R

Description

visualizes the correction of PAM values by correction value.

Usage

1
2
3
4
5
6
7
8
plotPAMcorr(
  df,
  al = -1,
  yl = c(0, 2),
  sortby = NULL,
  abs_dif = T,
  titel = "PAM Correction"
)

Arguments

df

data.frame - with column "CTR" for control values, "PAM" for pam values and optional "PAM_corr" for corrected PAM values.

al

numeric - a vector of numeric values on the x axes to draw lines. Default=0

yl

numeric - ylim adjustment. Default=c(0,2)

sortby

character - column name to reorder the inoput datafram 'df'. IF set the argument 'al' will not be used.

abs_dif

boolean - IF TRUE plots the differences as absolute values (no negative values). Default=TRUE.

titel

character - desired maintitel for the plot . Default="PAMcorrection".

Value

returns a plot containing the original PAM (orange) and Control (blue) values along with the difference (grey). If corrected PAM values are available those will be plotted in red along with the differnece between the corrected PAM and COntrol values. Additionally prints the total Difference along with mean and standart divation for PAM or if given PAM corrected and Control

Note

For visualization purposes the difference between the corrected PAM and Control is used as absolute values (negative values are plotted as positive). Further the mean and sd is calculated for the absolute values.

Author(s)

Andreas Schönberg

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# load data
dat <- read.csv(system.file("extdata","exp_PAM.csv",package = "PAMcorrection"))
head(dat)

# plot control and PAM
plotPAMcorr(dat)

# adjust y limit
plotPAMcorr(dat,yl = c(-1,4))

# use vertical lines
abl <- seq(10,40,10)
plotPAMcorr(dat,yl = c(0,4),al = abl)

# order values by PAM
plotPAMcorr(dat,sortby = "PAM")

# get correction value by mean
datf <-dat
datf$PAM_corr <-dat$PAM * mean(dat$CTR/dat$PAM) # factor

# plot correction and use titel
plotPAMcorr(datf,sortby = "PAM",titel="PAM corr factor")# for factor

# show difference in both poisitve and negative directions
plotPAMcorr(datf,sortby = "PAM",abs_dif=F,yl=c(-1,2))
# Note: The total and mean diffenrece is still calculcated in absolute values.

SchoenbergA/PAMcorrection documentation built on Jan. 28, 2022, 6:09 a.m.