I would like to plot y against z, where y=(1+z)int_0^z((0.3(1+z')^3+0.7)^-1/2)dz',
where int_0^z just means integrate from 0 to z. I figured I should first integrate from 0 to z, and then use the integral result to plug into the equation. Here is my code:
integrand <- function(z1) {(0.3*(1+z1)^3+0.7)^-1/2}
integral<-integrate(integrand, lower = 0, upper = z)
but this error appears:
Error: object 'any_number' not found
Error in integrate(integrand, lower = 0, upper = z) : object 'z' not found"
How do I define z
here?
Thanks,
Jade