Hi Kevin,
You should be able to do what you want directly from the `.Rmd` buffer. I
posted a tutorial here:
https://plantarum.ca/2021/10/03/emacs-tutorial-rmarkdown/
With the right packages installed, from the .Rmd buffer you can export your
file with `M-n e`, select `markdown` and `html` when prompted, and the html
will be generated and opened in a web browser.
The tutorial walks you through the steps in more detail.
Best,
Tyler
--
plantarum.ca
On Thu, Apr 20, 2023, at 12:11 PM, Kevin Zembower via ESS-help wrote:
> Thanks to Dirk Eddelbuettel's suggestion of his render.r executable, I
> was able to boil it down to the commands I need to render the Rmarkdown.
>
> I run this _once_ in the R console window of Emacs running ESS:
> library(rmarkdown)
>
> Then, everytime I want to update the document I'm working on, I run:
> render("working_file.Rmd")
>
> For me, that outputs an HTML document, that I view in my browser.
>
> I feel certain that there's a better, easier way to do this, in the
> Emacs/ESS/poly-R/Rmarkdown system, but this is what I needed to get me
> unstuck, and until I have some time to spare, this is as far as I'm
> taking it.
>
> Thanks, again, for the help.
>
> -Kevin
>
>
> Forwarded Message
> Subject: Emacs, ESS and Rmarkdown: Is this the way compile is supposed
> to work?
> Date: Sat, 15 Apr 2023 15:21:26 -0400
> From: Kevin Zembower
> To: ess-help@r-project.org
>
> I'm trying to get Emacs, ESS and Rmarkdown to work together for the
> first time. Therefore, the problem might be me, and not the software.
>
> I have this program as Prob_11.Rmd:
> ==
> ---
> title: "Problem 11, Page 414"
> author: "Kevin"
> date: "13 Apr 2023"
> output: html_document
> ---
>
> ### Load the sample data ###
>
> Loading the sample data table into two vectors:
>
> ``` {r}
>
> (age11 <- c(18, 10, 3, 15, 12, 14, 15, 4, 20, 8))
>
> (age16 <- c(6, 7, 14, 5, 14, 12, 3, 9, 4, 7))
>
> ```
>
>
> I get this as output after choosing Markdown->Preview & Export->Compile:
> =
>
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;>
>
> http://www.w3.org/1999/xhtml;>
>
>
> *markdown-output*
>
>
>
>
>
>
> Load the sample data
> Loading the sample data table into two vectors:
>
> (age11 - c(18, 10, 3, 15, 12, 14, 15, 4, 20, 8))
>
> (age16 - c(6, 7, 14, 5, 14, 12, 3, 9, 4, 7))
>
>
>
>
> ==
>
> This looks correct, except that I was expecting the last two lines to
> look like:
>
>> (age11 <- c(18, 10, 3, 15, 12, 14, 15, 4, 20, 8))
> [1] 18 10 3 15 12 14 15 4 20 8
>> (age16 <- c(6, 7, 14, 5, 14, 12, 3, 9, 4, 7))
> [1] 6 7 14 5 14 12 3 9 4 7
>
> Am I doing something wrong? Am I misunderstanding what RMarkdown is
> doing? I tried options like 'echo=TRUE' and 'eval=TRUE' without success.
>
> Thanks for any advice or guidance. I posted this request on
> stackoverflow.com, at
> https://stackoverflow.com/questions/76014830/emacs-ess-and-rmarkdown-is-this-the-way-compile-is-supposed-to-work,
>
> but didn't get any response.
>
> -Kevin
>
>
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help
__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help