TMWP
TMWP

Reputation: 1625

r markdown document - error about character options, but not seeing the mistake

I am probably missing something simple here. When I run code in an R markdown code cell, it throws this error:

(*) NOTE: I saw chunk options " dataFrames, echo=TRUE eval=TRUE"
 please go to http://yihui.name/knitr/options
 (it is likely that you forgot to quote "character" options)

Here is the code from the cell that triggered the error:

```{r dataFrames, echo=TRUE eval=TRUE}

df1 <- data.frame(c(1, 2, 3),
                 c("R","S","T"),
                 c(TRUE, FALSE, TRUE))
```

I tried the link given in the error, but did not run across anything that explained the glitch for me. Can anyone spot it?

Upvotes: 6

Views: 8025

Answers (2)

William Mitchell
William Mitchell

Reputation: 101

I just wanted to note that I also came across this issue when using a single apostrophe in the name of my chunk

i.e.:

{r Chronbach's Alpha} throws the error, but {r Chronbachs Alpha} does not.

Upvotes: 1

TMWP
TMWP

Reputation: 1625

Just noticed what appears to be the problem. Forgot a comma between the last two arguments as in:

```{r dataFrames, echo=TRUE, eval=TRUE}

not:

```{r dataFrames, echo=TRUE eval=TRUE}

oops.

Adding this in from the comments: If anyone else comes across this, it can also be caused by saying something like out.width=50% instead of out.width='50%' (with quotes).

Upvotes: 5

Related Questions