2

When naming code-chunks in R Markdown, the name of the chunk is given within the curly braces at the beginning of the chunk:

```{r some-name}
#some code
```

In quarto, the R Markdown style naming is applicable, but the preference is to use the label chunk-option:

```{r}
#| label: some-name

#some code
```

Are there ramifications I should be aware of when using the R Markdown style naming in quarto? I haven't noticed any consequences when using something like the dependson option, for example, but I'm curious as to whether there are other cases where the chosen method does have consequences.

2
  • 1
    Mostly no (except with non-R chunks) but in edge cases sometimes. I'm trying to remember the exact case - I think it was with pdf output when using \floatplacement{table}{!htbp}, with a label defined in the chunk options but a caption defined in the kableExtra() table code. It might not be exactly this - but in any case, why wouldn't you use the recommended approach? Especially as it's possible that a future version of Quarto will fully deprecate the rmd style. Commented Aug 26 at 9:28
  • 1
    @SamR, thanks for the information! You're right to point out that the recommended approach is the one that should be used. I simply found myself defaulting to the rmd syntax and my curiosity was piqued. Commented Aug 26 at 10:36

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.