I'm performing correlation analysis using the corrr package in R, but I'm unable to extract the p values. Does anyone know how to get the p values in corrr package in R?
I would suggest looking at some of the documentation.
As far as I can tell, the intention of the package is to visualize and organize correlation coefficient estimates. It does not seem that the author of the package has any interest in p-value estimation.
If you are interested in computing p-values, I would suggest using a different tool, such as the builtin
Here is a suggested workaround:
- Generate a p-value table using one of these tools:
corrr:as_cordf() to generate the tidy dataframe with the same structure as a regular corrr correlation table.
Personally, I have used the
Hmisc::rcorr() package, and it works well:
Hmisc::rcorr() %>% `[[`('P') %>% corrr::as_cordf()