Reputation: 209
I have a data frame with p.value
s and I want to adjust the p.values
. I used this commad:
Padjust = p.adjust(pvalues, "fdr")
pvalues
is my data frame with missing values and fdr
is the method that I wish to use. However, I´m getting the following error:
Error in p.adjust(pvalues, "fdr") :
(list) object cannot be coerced to type 'double
Upvotes: 1
Views: 6318
Reputation: 60462
The first argument of p.adjust
should be a vector, see
?p.adjust
In your specific case, you need to select the values from your data frame and pass them to the function, so something like:
p.adjust(pvalues$p.values, "fdr")
if the column name was p.values
. You could then add the adjusted p-values to your data frame via:
pvalues$adjust = p.adjust(pvalues$p.values, "fdr")
Upvotes: 3