[ESS] Emacs, ESS and Rmarkdown: Is this the way compile is supposed to work?

Kevin Zembower kev|n @end|ng |rom zembower@org
Sat Apr 15 21:21:30 CEST 2023


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:
=========================================================
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>*markdown-output*</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>

</head>

<body>

<h3 id="load-the-sample-data">Load the sample data</h3>
<p>Loading the sample data table into two vectors:</p>
<pre class="{r}"><code>
(age11 <- c(18, 10, 3, 15, 12, 14, 15, 4, 20, 8))

(age16 <- c(6, 7, 14, 5, 14, 12, 3, 9, 4, 7))
</code></pre>

</body>
</html>
==========================================================

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




More information about the ESS-help mailing list