You need to have the library that contains the function in your document in order for the function to be used. I'm guessing you're looking for rcorr() from the Hmisc package. So, you can either attack Hmisc, or prefix it Hmisc::rcorr().
The problem still exists after installing the package. This function works when I try to run junk but it could not create pdf file through knit function. Can you please try this with your codes in rmarkdown?