Problems using integrate while writing a likelihood function
I'm trying to write a likelihood function for a distribution which is defined by an integration. I'm using the integrate() function, but when I try to use this in the rest of the function I get the error:
"Error in B(alpha + i, beta + 6 - i)/B(alpha, beta) : non-numeric argument to binary operator"
The value of the integration is for example "9.501501 with absolute error < 0.00078". I've tried to use trunc() but this doesn't help either. I'm relatively new to R, so is there a known solution to this? Any help would be appreciated!