I wish to read in a text file and print it verbatim in a knitr doc. I got some code to read a text file into a string:
filename = 'foo.txt'
text = readChar(filename, file.info(filename)$size)
However, my every attempt to print out the text results in ugly craziness. Using print() does not wrap the lines. It leaves "## [1]" all over the output. Using results='asis' doesn't do what I want. Trying \verbatim and \spverbatim doesn't do the right thing.
What is the easy way out here?
I got this to work with
not in a knitr block.