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 very easy.
However, imagine you want to programmatically insert headers or lists to your report.
```{r, results='asis'}
headers=list("We","are","your","friends")
for (i in list_a){
#add i as header
}
```
and you want this to be the same as writing in your Rmd file:
#We
#are
#your
#friends
Another example would be to automatically create headers instead of lists:
```{r, results='asis'}
list_a=list("We","are","your","friends")
for (i in list_a){
#print i to a rmd list
}
```
as before this should have the same result as writing:
*We
*are
*your
*friends
This is not only a formatting problem as the table of context for Rmd files is created dynamically according to these headers.