Inflate Rmd to package
inflate(
pkg = ".",
flat_file,
vignette_name = "Get started",
open_vignette = TRUE,
check = TRUE,
document = TRUE,
overwrite = "ask",
...
)
Path to package
Path to Rmarkdown file to inflate
Character. Title of the resulting vignette.
Use NA
if you do not want to create a vignette.
Logical. Whether to open vignette file at the end of the process
Logical. Whether to check package after Rmd inflating
Logical. Whether to document your package using att_amend_desc
Logical (TRUE, FALSE) or character ("ask", "yes", "no). Whether to overwrite vignette and functions if already exists.
Arguments passed to rcmdcheck::rcmdcheck()
.
For example, you can do inflate(check = TRUE, quiet = TRUE)
, where quiet
is
passed to rcmdcheck::rcmdcheck()
.
Package structure. Return path to current package.
# Create a new project
dummypackage <- tempfile("dummypackage")
dir.create(dummypackage)
# {fusen} steps
dev_file <- add_flat_template(template = "full", pkg = dummypackage, overwrite = TRUE)
#> Created file .here in /tmp/Rtmp3Vk9Ap/dummypackage3f5815468046 . Please start a new R session in the new project directory.
flat_file <- dev_file[grepl("flat", dev_file)]
fill_description(pkg = dummypackage, fields = list(Title = "Dummy Package"))
#> [1] "/tmp/Rtmp3Vk9Ap/dummypackage3f5815468046/DESCRIPTION"
inflate(
pkg = dummypackage, flat_file = flat_file,
vignette_name = "Exploration of my Data", check = FALSE
)
#> ✔ Setting active project to '/tmp/Rtmp3Vk9Ap/dummypackage3f5815468046'
#> ℹ Loading dummypackage3f5815468046
#> Writing NAMESPACE
#> Loading required namespace: testthat
#> ✔ Adding 'knitr' to Suggests field in DESCRIPTION
#> ✔ Setting VignetteBuilder field in DESCRIPTION to 'knitr'
#> ✔ Adding 'inst/doc' to '.gitignore'
#> Updating dummypackage3f5815468046 documentation
#> ℹ Loading dummypackage3f5815468046
#> Writing NAMESPACE
#> Writing my_median.Rd
#> Writing my_other_median.Rd
#> Writing sub_median.Rd
#> ℹ Loading dummypackage3f5815468046
#> [+] 3 package(s) added: stats, rmarkdown, testthat.
#> [1] "/tmp/Rtmp3Vk9Ap/dummypackage3f5815468046"
# Explore directory of the package
# browseURL(dummypackage)
# Try pkgdown build
# usethis::use_pkgdown()
# pkgdown::build_site(dummypackage)
# Delete dummy package
unlink(dummypackage, recursive = TRUE)