getting started with rmarkdown

Opened new R Markdown document. Get the default template with summary(cars) and plot(pressure). Select "Run All" which works fine in the R Markdown pane (meaning I see the results), but when I knit it (to HTML), I don't get any of the code output in the HTML document. Instead, I see only:

{r cars} summary(cars)

and

{r pressure, echo=FALSE} plot(pressure)

What have I done wrong?

Not much options to do anything wrong, I think.
But maybe not all packages that you need for knitting are installed yet (?)

I think you need at least the package rmarkdown because installing that will also install packages as knitr and other packages. Did you install that?
You can see which packages are installed by typing in the R console:
installed.packages()[,1]
or checking the packages panel.
From the packages panel you can also install rmarkdown and dependencies (make sure that the install dependencies field is flagged).

You did not tell on what type of system your are working and maybe it is not relevant in this case.
Bit if installing missing packages does not work, it could become relevant.
Please inform us by copying the (first few lines of) the output of
sessionInfo()
in this message.

Maybe I didn't have everything installed. It seems it started working (not long after I posted this) as soon as I saved a .rmd file instead of knitting it (and then I could knit it later). But I installed a couple of other packages, and do see knitr and rmarkdown in the library directory, so (from what you said) maybe on of those installed them knitr and rmarkdown as dependencies.

It surprises me a bit that rstudio would display functionality (for example the knit button) without all of the components there to enable it (and without any warning).

Anyway, it appears that everything works fine now. Thank you for your help.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.