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