0

When I work in rmarkdown I'm often confronted with the following issue: The code inside the chunk does work but I can't knit the document because it tells me that there is an error on the line with the {r} or ```

```{r}
model1 <- lm(Density~Hardness)
coef(model1)
``` 

Error: attempt to use zero-length variable name
jay.sf
  • 60,139
  • 8
  • 53
  • 110
mararnold
  • 15
  • 3
  • 2
    You should make a complete document that has this problem and post it here -- we need something reproducible to see what's going wrong. It doesn't need to be a big document; minimal is best. – user2554330 Mar 25 '20 at 10:08
  • 1
    Does this answer your question? [rmarkdown error "attempt to use zero-length variable name"](https://stackoverflow.com/questions/46171362/rmarkdown-error-attempt-to-use-zero-length-variable-name) – jay.sf Mar 25 '20 at 10:13
  • Generally, RMD indicates errors for anything within a chunk referencing the first line of that chunk. In other words, your mistake can be anywhere inside the chunk. – broti Mar 25 '20 at 10:19

0 Answers0