Skip to content

Commit

Permalink
Doc : complete doc with att_from_examples
Browse files Browse the repository at this point in the history
- How to use att_from_examples

Issue #103
  • Loading branch information
MurielleDelmotte committed Aug 1, 2024
1 parent 85297a2 commit 76990ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vignettes/a-fill-pkg-description.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,14 @@ for (i in to_install) {

## Other possibilities

Of course, you can also use {attachment} out of a package to list all package dependencies of R scripts using `att_from_rscripts()` or Rmd files using `att_from_rmds()`.
Of course, you can also use {attachment} out of a package to list all package dependencies of R scripts using `att_from_rscripts()`, Rmd files using `att_from_rmds()` or examples from R scripts using `att_from_examples()`.

```{r, eval=TRUE}
dummypackage <- system.file("dummypackage", package = "attachment")
att_from_rscripts(path = file.path(dummypackage, "R"))
att_from_rmds(path = file.path(dummypackage, "vignettes"), inside_rmd = TRUE)
att_from_examples(dir.r = file.path(dummypackage, "R"))
```


6 changes: 6 additions & 0 deletions vignettes/b-bookdown-and-scripts.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ This reads all files in directories of R scripts (default to `R` directory of a
att_from_rscripts()
```

Called in examples from R scripts:

```{r, eval=FALSE}
att_from_examples()
```

## Get all packages called in your Rmd
If you have vignette, you may want to list extra libraries, not listed in your "Depends" list. This function applies to any Rmd file, of course.

Expand Down

0 comments on commit 76990ff

Please sign in to comment.