plotDRLevel: Visulize the drug response level

Description Usage Arguments Examples

View source: R/DRAP_code_1.5.11.r

Description

Visulize the drug response level for each arm.

Usage

1
2
3
plotDRLevel(data, by = c("Arms", "Tumor"), 
           pattern = c("oneAN",'TAN'), orders=NULL, 
           orders.1=NULL, orders.2=NULL,...)

Arguments

data

drug response level ,the output of DRLevel.

by

the level summaried by.

pattern

the pattern of PDX trial design, "oneAN" or "TAN".

orders

the redefined order while the argument "by" just contain one variable.

orders.1

the redefined order of the first varible while the argument "by" contain two variables.

orders.2

the redefined order of the second varible while the argument "by" contain two variables.

...

other parameters passed to ggplot

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
28
29
30
31
32
33
34
35
36
# NPDXE.criteria
npdxe.criteria <- data.frame(BestResponse.lower = c(-1000,-0.95,-0.5,0.35),
                             BestResponse.upper = c(-0.95,-0.5,0.35,1000),
                             BestAvgResponse.lower = c(-1000,-0.4,-0.2,0.3), 
                             BestAvgResponse.upper = c(-0.4,-0.2,0.3,1000), 
                             Level = c( 'CR','PR', 'SD','PD'))
npdxe.criteria
                            
### oneAN pattern
data(oneAN.volume.data)
oneAN.drl <- DRLevel(data = oneAN.volume.data, 
                     method = 'NPDXE.Response', 
                     criteria = npdxe.criteria, 
                     neg.control = 'Control')
DRLevelSummary(oneAN.drl,by = 'Arms')
plotDRLevel(data = oneAN.drl,by = 'Arms',pattern = 'oneAN')


### TAN pattern
data(TAN.volume.data)
TAN.drl <- DRLevel(data = TAN.volume.data, 
                   method = 'NPDXE.Response', 
                   criteria = npdxe.criteria, 
                   neg.control = 'Control')
DRLevelSummary(TAN.drl,by = 'Arms')
plotDRLevel(data = TAN.drl, by='Arms', pattern = 'TAN')
plotDRLevel(data = TAN.drl, by=c('Arms','Tumor'), pattern = 'TAN')

# rectify orders
arms <- unique(TAN.volume.data$Arms)
arms <- arms[-1]
arms
tumors <- unique(TAN.volume.data$Tumor)
tumors
plotDRLevel(data = TAN.drl, by = c('Arms','Tumor'), 
            pattern = 'TAN', orders.1 = arms, orders.2 = tumors)

SCBIT-YYLab/DRAP documentation built on April 7, 2020, 2:03 a.m.