'arg' must be NULL or a character vector
According to formals(prop.test)
or ?prop.test
the fourth argument is called alternative
and has to be a character of c("two.sided", "less", "greater")
. Your fourth element is conf.level
(which is the fifth of prop.test
, the order matters). To "ignore" the order of arguments you have to name your arguments (at least the conf.level
):
prop.test(x, n, p, conf.level=conf.level)
![Mona Jalal](https://i.stack.imgur.com/0MuAW.jpg?s=256&g=1)
Mona Jalal
contact me at [email protected] I am a 5th-year computer science Ph.D. Candidate at Boston University advised by Professor Vijaya Kolachalama in computer vision as the area of study. Currently, I am working on my proposal exam and thesis on the use of efficient computer vision and deep learning for cancer detection in H&E stained digital pathology images.
Updated on March 04, 2020Comments
-
Mona Jalal over 4 years
Here's a prop.test function:
baby.prop.test = function (x, n, p, conf.level = 0.95) { # ... return(prop.test(x,n,p,conf.level)) #baby.prop.test$statistic } # test case baby.prop = baby.prop.test(72, 100, .7, conf.level=.99) stopifnot(isTRUE(all.equal(as.numeric(baby.prop$statistic), .43643578))) stopifnot(isTRUE(all.equal(as.numeric(baby.prop$p.value), .66252058)))
Here is the error:
Error in match.arg(alternative) : 'arg' must be NULL or a character vector
Any idea what's wrong?