I am defining a function and trying to plot it for x > max{b1,b2}
:
b1<-1
b2<-2
b<-1
l<-1
fn <- function(x,b1,b2,b,l){
result <- b/x * ((1-(sqrt(1-(b1/x)^l)*sqrt(1-(b2/x)^l)))^(- 1/l))
return(result)
}
fn1 <- fn(x,b1,b2,b,l)
x<-seq(3,20,0.1)
plot(x,fn1,type="l")
It's working for these values but when I am changing x as follows x<-seq(3,100,0.1), it's showing an error:
Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ
Can you suggest what is the mistake here? How it can be removed?