constant <- function(x){1}
integrate(constant,lower=1,upper=10)
this is probably more than ridiculously simple, but any reason as to why this isn’t working?
is there a different way I should be writing the function for constants?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use the
Vectorizefunction to convert a non-vectorized function into the sort of function thatintegraterequires: