Jack Wasey
Jack Wasey

Reputation: 3440

How to include DESCRIPTION Description in rmarkdown vignette

It used to be possible to include a magic string in a Rmd vignette, and it would pull the Description field from DESCRIPTION. This is a nightmare to search because of the reuse of the word. I've searched the source and documentation for knitr, rmarkdown and roxygen2, and can't find it anywhere. I also looked in Hadley Wickham's R packaging book.

I also tried inserting "DESCRIPTION" in the vignette text (not R block), but it didn't work.

I remember it being a slightly bizarre syntax, with some punctuation, and the capitalized word DESCRIPTION, but I can't get any further.

Upvotes: 0

Views: 67

Answers (1)

Dirk is no longer here
Dirk is no longer here

Reputation: 368271

Works for me with a standard knitr block just calling the function displaying it:

```{r desc}
packageDescription("rmarkdown")
```

You can play tricks with echo=FALSE etc pp

And if you really just want the Description entry, do

```{r descDesc}
packageDescription("rmarkdown")$Description
```

Upvotes: 3

Related Questions