It's not about installation, it's about calling the library first. Here's a gist with the .Rmd and the .md, which I just knit successfully.
The body of the Rmd here, too.
---
title: '`rcorr()` test'
author: "Mara Averick"
date: "6/25/2019"
output:
html_document:
keep_md: TRUE
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, collapse = TRUE)
```
```{r}
library(Hmisc)
```
```{r}
x <- c(-2, -1, 0, 1, 2)
y <- c(4, 1, 0, 1, 4)
z <- c(1, 2, 3, 4, NA)
v <- c(1, 2, 3, 4, 5)
rcorr(cbind(x,y,z,v))
```