I am trying to display R code and output in the CANVAS LMS (specifically within a page, not just as a separate html file). I have had no joy Googling this so hopefully someone can help.
What I have tried (as a simple test) but hasn't worked: In RStudio created a new RMarkdown HTML document (the basic default one with a sample table and sample plot). Used Knitr to create the html file. Opened HTML file and copied code into the LMS (raw html editor). This kind of works but doesn't show the plot and has some of the code that I didn't need to copy (see image).
Presumably there is a smarter way to do this but I can't find any good resources.