[BlindRUG] Question about R Markdown

Liz Hare doggene at earthlink.net
Sat Mar 20 17:20:30 UTC 2021


Hi Niels,

As you start writing your .Rmd, there are two questions to think about:

1: what kind of output document do you want? (choices include HTML, PDF, Word, and many others)

I recommend HTML for accessibility if you want to use it to look at your tables, for example.

2. do you want your code to appear in the output document?

More details

1. The beginning of an Rmd file is the YAML header, which contains general information about the document, including what kind of output you want. It looks like


---
title: "Document Title"
author: "Your Name"
output:
    html_output
---

There can be a lot of other specifications between the opening and closing sets of three hyphens.

2. As a big generalization, you put R code in Rmd files into "chunks." They are delimited by sets of three back-quotes like

```{r, results="asis", echo="FALSE"}
<some R code>
```

the settings I have after the r in the first line request that R's results are included in the output, but the code isn't. leave the 'echo=FALSE' out if you want to display your code.

All the area outside of the R chunks comes through as regular text in your document. There's a way of putting short R code inline, but this is probably enough to get you started.

Liz

> On Mar 19, 2021, at 5:45 PM, Niels Luithardt via BlindRUG <blindrug at nfbnet.org> wrote:
> 
> Hello,
> 
> I have a question about RMarkdown:
> 
> I want to create a .rmd file and I have thought of the following example for it:
> 
> dice<-sample(1:6,50,replace=TRUE)
> table(dice)
> round(table(dice)/50,digits = 3)
> barplot(table(dice),width=1,col="blue", cex.axis=2.8,cex.names=2.8)
> What must be the rest of the markdown file for my code to be
> processed successfully?
> 
> I would be very pleased about answers!
> 
> Kind regards
> 
> Niels
> 
> _______________________________________________
> BlindRUG mailing list
> BlindRUG at nfbnet.org
> http://nfbnet.org/mailman/listinfo/blindrug_nfbnet.org
> To unsubscribe, change your list options or get your account info for BlindRUG:
> http://nfbnet.org/mailman/options/blindrug_nfbnet.org/doggene%40earthlink.net
> The list archive can be viewed at:
> http://www.nfbnet.org/pipermail/blindrug_nfbnet.org
> More information and useful links about using R as a blind person can be obtained at:
> http://R-Resources.massey.ac.nz
> 
> Look for help using R commands by reading the accessible e-book "Let's Use R Now" compiled by Jonathan Godfrey at:
> http://R-Resources.massey.ac.nz/lurn/front.html




More information about the BlindRUG mailing list