harkintr
harkintr

Reputation: 11

Parse error in .Rmd

I'm trying to knit an .Rmd and I keep getting

Error in parse(text = x, srcfile = src) : <text>:1:1: unexpected '$'

The line that is generating this error message is:

$\frac{51}{60}$

Any idea why I'm getting this message? I've tried all variations of $ and / in the equation, and even copied and pasted a different fraction example I found online and still get that message

Upvotes: 0

Views: 2521

Answers (1)

neilfws
neilfws

Reputation: 33782

You're probably putting that line inside a chunk:

```{r}
# don't put me here!
```

Put it in the main body of the document instead.

Upvotes: 2

Related Questions