比如这个函数:
prop.test(x, n, p = NULL,
alternative = c("two.sided", "less", "greater"),
conf.level = 0.95, correct = TRUE)
数据是像这样的:
> head(a)
[,1] [,2]
[1,] 553 2135
[2,] 501 2170
[3,] 556 2145
[4,] 539 2147
想让函数的参数p=0.3
再对每行运行,如 prop.test(x=553,t=2135,p=0.3)
要怎么写呢?
想用: apply(a,1,prop.test) 一是参数p不知道怎么传,二是出错了.