When using R markdown if one wants to add text using code there are some simple ways to do it.
This is also true for tables, using the kable command is
You need to construct your wanted markdown in R and use that together with the argument results = 'asis' in your chunk options. Hence, something like the following will do what you want:
```{r, results='asis'}
headers <- list("We","are","your","friends")
for (i in headers){
cat("#", i, "\n")
}
```
The for-loop here will create the output
# We
# are
# your
# friends
which is used directly as input in the .md document.