This is a basic question for which I am getting the following error.
Error in prop.test: 'x' and 'n' must have the same length
cv_MH$pval <- (prop.test(x = c(cv_MH$search, cv_MH$against), n = c(size, size2)))$p.value
I think you need to repeat the counts (n) for each value in x. What about this ?
cv_MH$pval <- prop.test(x = c(cv_MH$search, cv_MH$against), n = c(rep(size, length(cv_MH$search)), rep(size2, length(cv_MH$against))))$p.value
x indicates the number of success (events of interest) and n the total number of events... x should have the same length of n, as suggested by your error message