inst/doc/b-bookdown-and-scripts.R

## ----setuprmd, include = FALSE------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

## -----------------------------------------------------------------------------
library(attachment)

## ---- eval=FALSE--------------------------------------------------------------
#  usethis::use_description()

## ---- eval=FALSE--------------------------------------------------------------
#  # bookdown Imports are in Rmds
#  imports <- c("bookdown", attachment::att_from_rmds("."))
#  
#  attachment::att_to_desc_from_is(
#    path.d = "DESCRIPTION",
#    imports = imports, suggests = NULL,
#    must.exist = FALSE
#  )

## ---- eval=FALSE--------------------------------------------------------------
#  # install.packages("remotes")
#  remotes::install_deps()

## ----eval=FALSE---------------------------------------------------------------
#  attachment::att_to_desc_from_is(
#    path.d = "DESCRIPTION",
#    imports = imports, suggests = NULL,
#    must.exist = FALSE
#  ) %>%
#    set_remotes_to_desc()

## ---- eval=FALSE--------------------------------------------------------------
#  att_from_namespace()

## ---- eval=FALSE--------------------------------------------------------------
#  att_from_rscripts()

## ---- eval=FALSE--------------------------------------------------------------
#  att_from_rmds()

## ---- eval=TRUE---------------------------------------------------------------
dummypackage <- system.file("dummypackage", package = "attachment")

att_from_rmds(path = file.path(dummypackage, "vignettes"), inside_rmd = TRUE)

Try the attachment package in your browser

Any scripts or data that you put into this service are public.

attachment documentation built on June 7, 2023, 5:19 p.m.