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
Use the pander package, which transform R objects into Pandoc's markdown:
> headers=list("We","are","your","friends")
> list_a=list("We","are","your","friends")
> library(pander)
> pandoc.header(headers)
# We
# are
# your
# friends
> pander(list_a)
* We
* are
* your
* friends
The first example used a helper function to create the headers, while the second demo simply called the generic S3 method, that can robustly transform a variety of R objects into markdown.