Description Usage Arguments Value Examples
View source: R/Prob_developing_resistance.R
Probability of resistance at time t
1 2 | Prob_resistance(t, type_0, type_i, N, approximation = T,
int.function = c("integrate", "pracma"))
|
t |
time of production of a resistant cell clone |
type_0 |
Type-0 S4 object |
type_i |
Type-i S4 object |
N |
number of resistant cell clones |
approximation |
logical argument indicating if an approximation of the numerical integration method must be used or not. Default to TRUE for faster computation. |
int.function |
integration function. Possible options are "integrate" or "pracma". The default option is integrate function in R. If "pracma" is selected, the numerical integration methods from pracma package are used (more robust but slower option). |
returns the probability that there exists at least one resistant cell of any type at time T after treatment iniciation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
#Birth rate of sensitive cells as a function of time:
b0 <- function(time){0.05*sin(0.1*time)+0.14}
#Birth rate of resistant cells as a function of time:
b1 <- function(time){0.05*sin(0.1*time)+0.12}
#Create Type-0 S4 object structure with the parameters of sensitive cells
Type0 <-define.Type0.cells(N0=100,birth_rate = b0,death_rate= 0.14)
#Create Type-i S4 object structure with the parameters of resistant cells
Type1 <- define.Typei.cells(Ni=0,birth_rate = b1,death_rate= 0.1,mutation_rate=10^-3)
Group the resistant cells types in a list
Type_i<-list(Type1)
Call the function:
Prob_resistance(t=100,type_0=Type0,type_i=Type_i,N=1)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.