I am really new to R. Allow me to ask a beginner's question.
When I type p.adjust, for example, I can see the following. It seems that the argument method is p.adjust.methods by default. I tried to trace the code but when I typed something like:
match.arg(p.adjust.methods)
It says:
Error in match.arg(p.adjust.methods) : 'arg' must be of length 1
Why?
> p.adjust
function (p, method = p.adjust.methods, n = length(p))
{
method <- match.arg(method)
...
}
The match.arg
function does not work in interactive mode in its one argument form, since there is nothing to match to. That first argument is expected to be a length 1 character vector, and it is tested against the known methods _inside_the_function_:
> ?p.adjust
> p.adjust.methods
[1] "holm" "hochberg" "hommel" "bonferroni" "BH" "BY" "fdr"
[8] "none"
(The first argument to p.adjust
if you are using positional matching needs to be a vector of p-values.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With