From 0307c235e924f5e3f389bd921eb4958bd10f4b5f Mon Sep 17 00:00:00 2001 From: ymansiaux <49268931+ymansiaux@users.noreply.github.com> Date: Mon, 10 Jun 2024 08:38:45 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20ThinkR-o?= =?UTF-8?q?pen/fusen@3c452e74b357238ccfc6c3f5a775f0c48d46f377=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dev/CODE_OF_CONDUCT.html | 3 +- dev/CONTRIBUTING.html | 3 +- dev/LICENSE-text.html | 3 +- dev/LICENSE.html | 3 +- dev/apple-touch-icon-120x120.png | Bin 12336 -> 12336 bytes dev/apple-touch-icon-152x152.png | Bin 16882 -> 16882 bytes dev/apple-touch-icon-180x180.png | Bin 21023 -> 21023 bytes dev/apple-touch-icon-60x60.png | Bin 4685 -> 4685 bytes dev/apple-touch-icon-76x76.png | Bin 6318 -> 6318 bytes dev/apple-touch-icon.png | Bin 21023 -> 21023 bytes dev/articles/How-to-use-fusen.html | 3 +- .../Maintain-packages-with-fusen.html | 3 +- dev/articles/deal-with-a-fusen-flat-file.html | 3 +- ...e-of-your-package-files-and-functions.html | 16 +- dev/articles/index.html | 5 +- dev/articles/inflate-all-your-flat-files.html | 3 +- dev/articles/register-files-in-config.html | 3 +- dev/articles/share-on-a-github-website.html | 3 +- ...ped-with-fusen-to-a-classical-package.html | 246 ++++++++++++++++++ dev/articles/tips-and-tricks.html | 3 +- dev/authors.html | 7 +- dev/favicon-16x16.png | Bin 1164 -> 1164 bytes dev/favicon-32x32.png | Bin 2262 -> 2262 bytes dev/index.html | 3 +- dev/news/index.html | 12 +- dev/pkgdown.yml | 3 +- dev/reference/add_flat_template.html | 7 +- dev/reference/add_fusen_chunks.html | 3 +- dev/reference/check_not_registered_files.html | 5 +- dev/reference/create_fusen.html | 13 +- dev/reference/deprecate_flat_file.html | 3 +- dev/reference/fill_description.html | 3 +- dev/reference/fusen-package.html | 3 +- dev/reference/get_all_created_funs.html | 3 +- dev/reference/get_package_structure.html | 9 +- dev/reference/index.html | 13 +- dev/reference/inflate.html | 15 +- dev/reference/inflate_all.html | 27 +- dev/reference/init_share_on_github.html | 3 +- dev/reference/load_flat_functions.html | 3 +- dev/reference/pipe.html | 3 +- dev/reference/register_all_to_config.html | 7 +- dev/reference/rename_flat_file.html | 3 +- dev/reference/sepuku.html | 211 +++++++++++++++ dev/reference/sepuku_utils.html | 103 ++++++++ dev/search.json | 2 +- dev/sitemap.xml | 9 + 47 files changed, 698 insertions(+), 75 deletions(-) create mode 100644 dev/articles/switch-from-a-package-developed-with-fusen-to-a-classical-package.html create mode 100644 dev/reference/sepuku.html create mode 100644 dev/reference/sepuku_utils.html diff --git a/dev/CODE_OF_CONDUCT.html b/dev/CODE_OF_CONDUCT.html index 5ee9780..1da436b 100644 --- a/dev/CODE_OF_CONDUCT.html +++ b/dev/CODE_OF_CONDUCT.html @@ -10,7 +10,7 @@ fusen - 0.6.0.9000 + 0.6.0.9001 + + + + + +
+ + + + +
+
+ + + + + +
+

Move from a package developed with fusen to a “classical” +package +

+

After a while, you may want to move from a package developed with +fusen to a “classical” package. This is possible with the +sepuku() function. This function will delete all the flat +files (i.e files listed in the fusen configuration file, as well as rmd +or qmd files starting with “flat” in the “dev/” and “dev/flat_history” +folders). It will also remove the fusen-related tags added by calls to +fusen::inflate() in files located in the “R/”, “tests/” and +“vignettes/” folders. Finally, it will also remove the fusen +configuration file if it exists.

+

Switching from a package developed with fusen to a “classical” +package might be useful if you want to share your package with someone +who is not familiar with fusen or if you want to stop using fusen for +any reason.

+

Please be aware that this operation is irreversible. You will lose +all the history of your flat files and the fusen-related tags in your +package. Therefore, it is recommended to use code versioning to be able +to revert this, in case you would change your mind.

+
+#' \dontrun{
+sepuku()
+# If you want to force the cleaning, you can use the force argument
+sepuku(force = TRUE)
+
+# Example with a dummy package
+dummypackage <- tempfile("sepuku.example")
+dir.create(dummypackage)
+fill_description(pkg = dummypackage, fields = list(Title = "Dummy Package"))
+
+usethis::with_project(dummypackage, {
+  # Add licence
+  usethis::use_mit_license("John Doe")
+
+  dir.create(file.path(dummypackage, "dev"))
+  dir.create(file.path(dummypackage, "dev", "flat_history"))
+
+  # We add 2 flat files in the package and inflate them
+  dev_file1 <- add_minimal_flat(
+    pkg = dummypackage,
+    flat_name = "flat1.Rmd",
+    open = FALSE
+  )
+
+  dev_file2 <- add_minimal_flat(
+    pkg = dummypackage,
+    flat_name = "flat2.Rmd",
+    open = FALSE
+  )
+
+  inflate(
+    pkg = dummypackage,
+    flat_file = dev_file1,
+    vignette_name = "Get started",
+    check = FALSE,
+    open_vignette = FALSE,
+    document = TRUE,
+    overwrite = "yes"
+  )
+
+  inflate(
+    pkg = dummypackage,
+    flat_file = dev_file2,
+    vignette_name = "Get started 2",
+    check = FALSE,
+    open_vignette = FALSE,
+    document = TRUE,
+    overwrite = "yes"
+  )
+
+  # We deprecate the first flat file, which will be moved to the flat_history folder
+  deprecate_flat_file(
+    file.path(dummypackage, "dev", "flat_flat1.Rmd")
+  )
+
+  # We create 2 flat files with the qmd extension
+  file.create(file.path(dummypackage, "dev", "flat_history", "flat_old.qmd"))
+  file.create(file.path(dummypackage, "dev", "flat_qmd.qmd"))
+
+  sepuku(force = TRUE)
+
+  # We check that the fusen configuration file has been deleted
+  file.exists(
+    file.path(dummypackage, "dev", "config_fusen.yaml")
+  )
+
+  # We check that all the flat files have been deleted
+  length(
+    list.files(file.path(dummypackage, "dev"),
+      pattern = "^flat.*\\.Rmd"
+    )
+  )
+
+  length(
+    list.files(file.path(dummypackage, "dev"),
+      pattern = "^flat.*\\.qmd"
+    )
+  )
+
+
+  length(
+    list.files(file.path(dummypackage, "dev", "flat_history"),
+      pattern = "^flat.*\\.Rmd"
+    )
+  )
+
+
+  length(
+    list.files(file.path(dummypackage, "dev", "flat_history"),
+      pattern = "^flat.*\\.qmd"
+    )
+  )
+
+  # We check that all the files with fusen tags have been cleaned
+  length(fusen:::find_files_with_fusen_tags(pkg = dummypackage))
+})
+
+# Clean the temporary directory
+unlink(dummypackage, recursive = TRUE)
+#' }
+
+
+
+ + + +
+ + + +
+
+ + + + + + + diff --git a/dev/articles/tips-and-tricks.html b/dev/articles/tips-and-tricks.html index 70888b2..e0520e7 100644 --- a/dev/articles/tips-and-tricks.html +++ b/dev/articles/tips-and-tricks.html @@ -34,7 +34,7 @@ fusen - 0.6.0.9000 + 0.6.0.9001
+ + + + + +
+
+
+ +
+

This function will delete all the flat files (i.e files listed in the fusen configuration file, as well as rmd or qmd files starting with "flat" in the "dev/" and "dev/flat_history" folders). It will also remove the fusen-related tags added by calls to fusen::inflate() in files located in the "R/", "tests/" and "vignettes/" folders. Finally, it will also remove the fusen configuration file if it exists.

+
+ +
+

Usage

+
sepuku(pkg = ".", force = FALSE)
+
+ +
+

Arguments

+
pkg
+

Character. Path of the current package

+ + +
force
+

logical. whether to force the cleaning or not, without asking if the user is sure about making this operation (default: FALSE)

+ +
+
+

Value

+ + +

side effect. A package cleaned from fusen-related files or tags

+
+ +
+

Examples

+
if (FALSE) {
+sepuku()
+# If you want to force the cleaning, you can use the force argument
+sepuku(force = TRUE)
+
+# Example with a dummy package
+dummypackage <- tempfile("sepuku.example")
+dir.create(dummypackage)
+fill_description(pkg = dummypackage, fields = list(Title = "Dummy Package"))
+
+usethis::with_project(dummypackage, {
+  # Add licence
+  usethis::use_mit_license("John Doe")
+
+  dir.create(file.path(dummypackage, "dev"))
+  dir.create(file.path(dummypackage, "dev", "flat_history"))
+
+  # We add 2 flat files in the package and inflate them
+  dev_file1 <- add_minimal_flat(
+    pkg = dummypackage,
+    flat_name = "flat1.Rmd",
+    open = FALSE
+  )
+
+  dev_file2 <- add_minimal_flat(
+    pkg = dummypackage,
+    flat_name = "flat2.Rmd",
+    open = FALSE
+  )
+
+  inflate(
+    pkg = dummypackage,
+    flat_file = dev_file1,
+    vignette_name = "Get started",
+    check = FALSE,
+    open_vignette = FALSE,
+    document = TRUE,
+    overwrite = "yes"
+  )
+
+  inflate(
+    pkg = dummypackage,
+    flat_file = dev_file2,
+    vignette_name = "Get started 2",
+    check = FALSE,
+    open_vignette = FALSE,
+    document = TRUE,
+    overwrite = "yes"
+  )
+
+  # We deprecate the first flat file, which will be moved to the flat_history folder
+  deprecate_flat_file(
+    file.path(dummypackage, "dev", "flat_flat1.Rmd")
+  )
+
+  # We create 2 flat files with the qmd extension
+  file.create(file.path(dummypackage, "dev", "flat_history", "flat_old.qmd"))
+  file.create(file.path(dummypackage, "dev", "flat_qmd.qmd"))
+
+  sepuku(force = TRUE)
+
+  # We check that the fusen configuration file has been deleted
+  file.exists(
+    file.path(dummypackage, "dev", "config_fusen.yaml")
+  )
+
+  # We check that all the flat files have been deleted
+  length(
+    list.files(file.path(dummypackage, "dev"),
+      pattern = "^flat.*\\.Rmd"
+    )
+  )
+
+  length(
+    list.files(file.path(dummypackage, "dev"),
+      pattern = "^flat.*\\.qmd"
+    )
+  )
+
+
+  length(
+    list.files(file.path(dummypackage, "dev", "flat_history"),
+      pattern = "^flat.*\\.Rmd"
+    )
+  )
+
+
+  length(
+    list.files(file.path(dummypackage, "dev", "flat_history"),
+      pattern = "^flat.*\\.qmd"
+    )
+  )
+
+  # We check that all the files with fusen tags have been cleaned
+  length(fusen:::find_files_with_fusen_tags(pkg = dummypackage))
+})
+
+# Clean the temporary directory
+unlink(dummypackage, recursive = TRUE)
+}
+
+
+
+ + +
+ + + +
+ + + + + + + diff --git a/dev/reference/sepuku_utils.html b/dev/reference/sepuku_utils.html new file mode 100644 index 0000000..46c1408 --- /dev/null +++ b/dev/reference/sepuku_utils.html @@ -0,0 +1,103 @@ + +List all flat files present in the package — list_flat_files • fusen + Skip to contents + + +
+
+
+ +
+

Search for flat files listed in fusen config file, and for rmd and qmd files starting with "flat_" in dev/ folder, and dev/flat_history folder

+
+ +
+

Usage

+
list_flat_files(pkg = ".")
+
+ +
+

Arguments

+
pkg
+

Path to package

+ +
+
+

Value

+ + +

a vector of flat files paths

+
+ +
+ + +
+ + + +
+ + + + + + + diff --git a/dev/search.json b/dev/search.json index e244c2d..3aa6375 100644 --- a/dev/search.json +++ b/dev/search.json @@ -1 +1 @@ -[{"path":[]},{"path":"https://thinkr-open.github.io/fusen/dev/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement [INSERT CONTACT METHOD]. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.0, available https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. Community Impact Guidelines inspired Mozilla’s code conduct enforcement ladder. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https:// www.contributor-covenant.org/translations.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing to fusen","title":"Contributing to fusen","text":"outlines propose change fusen.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CONTRIBUTING.html","id":"all-contribution-welcomed","dir":"","previous_headings":"","what":"All contribution welcomed","title":"Contributing to fusen","text":"open contribution, typos new features. guide throughout process make safe position contribute, whatever level R programming.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CONTRIBUTING.html","id":"use-of-fusen-to-build-the-code-base-and-documentation","dir":"","previous_headings":"","what":"Use of ‘fusen’ to build the code base and documentation","title":"Contributing to fusen","text":"Package ‘fusen’ used build code base documentation ‘fusen’. ‘fusen’ package provides framework building R packages Rmarkdown file (Quarto file). See documentation ‘fusen’ details: https://thinkr-open.github.io/fusen","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CONTRIBUTING.html","id":"what-if-i-do-not-understand-how-to-use-fusen-","dir":"","previous_headings":"","what":"What if I do not understand how to use ‘fusen’ ?","title":"Contributing to fusen","text":"help. know modify package without ‘fusen’, contribute normally. Forget flat files moment. ‘fusen’ package still classical package remove “dev/” directory. difference. Open Pull Request help integrate contribution ‘fusen’ framework.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CONTRIBUTING.html","id":"some-tips-to-contribute-with-fusen","dir":"","previous_headings":"","what":"Some tips to contribute with ‘fusen’","title":"Contributing to fusen","text":"modifications can realized modifying ‘flat’ file “dev/” directory. , run fusen::inflate_all() generate corresponding R, test vignette files. can see list active flat files corresponding generated files opening “dev/config_fusen.yaml” file. one section flat file. see text like \"# WARNING - Generated 'fusen' dev/flat_***.Rmd: edit hand\" top generated R, test vignette files, actually generated ‘fusen’. file, generated ‘fusen’, listed \"keep\" section “dev/config_fusen.yaml” file. can run fusen::check_not_registered_files() check ’s case.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CONTRIBUTING.html","id":"modify-documentation","dir":"","previous_headings":"Some tips to contribute with ‘fusen’","what":"Modify documentation","title":"Contributing to fusen","text":"find roxygen skeleton corresponding function chunk Text vignette generally text chunk flat file","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CONTRIBUTING.html","id":"modify-of-a-function","dir":"","previous_headings":"Some tips to contribute with ‘fusen’","what":"Modify of a function","title":"Contributing to fusen","text":"recommend test driven development approach: Write modify unit test corresponding test chunk function Modify code function corresponding function chunk Run ‘inflate’ command bottom flat file Run devtools::test() check test passing avoid multiple inflates, can run code locally Instead inflating, run fusen::load_flat_functions() load function current flat file global environment Run tests line line test chunk can also use favorite debuging tools","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CONTRIBUTING.html","id":"fixing-typos","dir":"","previous_headings":"","what":"Fixing typos","title":"Contributing to fusen","text":"can fix typos, spelling mistakes, grammatical errors documentation directly using GitHub web interface, long changes made source file. generally means ’ll need edit roxygen2 comments .R, .Rd file. can find .R file generates .Rd reading comment first line.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CONTRIBUTING.html","id":"bigger-changes","dir":"","previous_headings":"","what":"Bigger changes","title":"Contributing to fusen","text":"want make bigger change, ’s good idea first file issue make sure someone team agrees ’s needed. ’ve found bug, please file issue illustrates bug minimal reprex (also help write unit test, needed).","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CONTRIBUTING.html","id":"pull-request-process","dir":"","previous_headings":"Bigger changes","what":"Pull request process","title":"Contributing to fusen","text":"Fork package clone onto computer. haven’t done , recommend using usethis::create_from_github(\"ThinkR-open/fusen\", fork = TRUE). Install development dependences devtools::install_dev_deps(), make sure package passes R CMD check running devtools::check(). R CMD check doesn’t pass cleanly, ’s good idea ask help continuing. Create Git branch pull request (PR). recommend using usethis::pr_init(\"brief-description--change\"). Make changes Open dev/dev_history.R file: rstudioapi::navigateToFile(\"dev/dev_history.R\") Find “# Dependencies —-” part run attachment::att_amend_desc(...) presented . update documentation list dependencies DESCRIPTION ones needed {fusen}. Commit git, create PR running usethis::pr_push(), following prompts browser. title PR briefly describe change. body PR contain Fixes #issue-number. user-facing changes, add bullet top NEWS.md (.e. just first header). Follow style described https://style.tidyverse.org/news.html.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CONTRIBUTING.html","id":"code-style","dir":"","previous_headings":"Bigger changes","what":"Code style","title":"Contributing to fusen","text":"New code follow tidyverse style guide. can use styler package apply styles, please don’t restyle code nothing PR. use roxygen2, Markdown syntax, documentation. use testthat unit tests. Contributions test cases included easier accept.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contributing to fusen","text":"Please note fusen project released Contributor Code Conduct. contributing project agree abide terms.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2019 ThinkR Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/How-to-use-fusen.html","id":"all-steps-to-create-a-package-with-fusen-from-one-rmd-file","dir":"Articles","previous_headings":"","what":"All steps to create a package with {fusen} from one Rmd file","title":"How to use fusen","text":"RStudio template: File > New Project > New directory > Package using {fusen} Choose template teaching start command line: create_fusen(\"path//new/project\", template = \"teaching\") Open “dev/flat_teaching” Rmd start setting package Run content first development chunk library(testthat) inside first time, can let code , already content working package Chunk named function gets code function Chunk named example gets code examples using function. used function @examples kept vignette Chunk named tests gets code unit testing Chunk named development gets code development purposes, usually used like {usethis} functions Run dev-inflate chunk inflate flat template transform inflated package functions, unit tests current Rmd template transformed vignette. check. Build {pkgdown} site verify everything right place Create multiple \"flat_xxx.Rmd\" files fusen::add_flat_template(template = \"add\") needed","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/How-to-use-fusen.html","id":"fill-your-package-description","dir":"Articles","previous_headings":"All steps to create a package with {fusen} from one Rmd file","what":"Fill your package Description","title":"How to use fusen","text":"Function fill_description() requires description package: ? developers? fill DESCRIPTION file proper way.","code":"fill_description( pkg = dummypackage, fields = list( Title = \"Build A Package From Rmarkdown file\", Description = paste( \"Use Rmarkdown First method to build your package.\", \"Start your package with documentation.\", \"Everything can be set from a Rmarkdown file in your project.\" ), `Authors@R` = c( person(\"John\", \"Doe\", email = \"john@email.me\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0000-0000-0000\")), person(given = \"Company\", role = \"cph\") ) ) )"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/How-to-use-fusen.html","id":"inflate-your-package-from-the-flat-rmd-template","dir":"Articles","previous_headings":"All steps to create a package with {fusen} from one Rmd file","what":"Inflate your package from the flat Rmd template","title":"How to use fusen","text":"’re one inflate flat paper box. Build package flat Rmd template using inflate() command . , can: Verify \"DESCRIPTION\" file updated Verify function \"R/\" directory Verify test \"tests/testthat/\" directory Verify Rmd appears \"vignettes/\" directory Build documentation using usethis::use_pkgdown() pkgdown::build() vignette examples checks","code":"fusen::inflate( flat_file = \"dev/flat_teaching.Rmd\", vignette_name = \"Exploration of my Data\", open_vignette = TRUE, document = TRUE, check = TRUE )"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/How-to-use-fusen.html","id":"create-a-new-package-from-command-line-directly-using-a-pre-defined-template","dir":"Articles","previous_headings":"","what":"Create a new package from command line directly, using a pre-defined template","title":"How to use fusen","text":"testing purposes","code":"# Create a new project dummypackage <- tempfile(pattern = \"dummy\") # {fusen} steps dev_file <- create_fusen(dummypackage, template = \"teaching\", open = FALSE) # Description fusen::fill_description(pkg = dummypackage, fields = list(Title = \"Dummy Package\")) # From inside the package usethis::with_project(dummypackage, { # Define License with use_*_license() usethis::use_mit_license(\"John Doe\") # You may need to execute inflate() in the console directly fusen::inflate( pkg = dummypackage, flat_file = dev_file, vignette_name = \"Get started\" ) }) # Explore directory of the package browseURL(dummypackage) # Delete dummy package unlink(dummypackage, recursive = TRUE)"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/How-to-use-fusen.html","id":"add-a-new-flat_template-rmd-template-in-dev-directory","dir":"Articles","previous_headings":"","what":"Add a new “flat_template.Rmd” template in “dev/” directory","title":"How to use fusen","text":"","code":"# Add an additional dev template add_flat_template(template = \"add\", pkg = dummypackage) # or directly add_additional(pkg = dummypackage)"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/How-to-use-fusen.html","id":"there-can-be-development-actions","dir":"Articles","previous_headings":"","what":"There can be development actions","title":"How to use fusen","text":"included flat template file, content part package anywhere else. Name following chunk {r development-something, eval=FALSE}","code":"```{r development-inflate, eval=FALSE} # Run but keep eval=FALSE to avoid infinite loop usethis::use_mit_license(\"John Doe\") # Execute in the console directly fusen::inflate(flat_file = \"dev/dev_history.Rmd\") ```"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/How-to-use-fusen.html","id":"limitations","dir":"Articles","previous_headings":"","what":"Limitations","title":"How to use fusen","text":"One title / one chunk one function examples tests chunks need placed associated function chunk can add sub-functions function chunk store R file, won’t @examples. first function chunk able get examples. Rmarkdown file, chunk names need unique. Thus, better use examples-myfunction, examples-myotherfunction, … forget regularly clear Workspace avoid functions hidden global environment","code":""},{"path":[]},{"path":"https://thinkr-open.github.io/fusen/dev/articles/Maintain-packages-with-fusen.html","id":"add-a-new-set-of-chunks-in-the-current-rmd","dir":"Articles","previous_headings":"Daily use of {fusen}","what":"Add a new set of chunks in the current Rmd","title":"Maintain packages with {fusen}","text":"Use Addin “Add {fusen} chunks” Name chunks using function name planned created Decide function exported user ","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/Maintain-packages-with-fusen.html","id":"create-a-new-flat-rmd-template","dir":"Articles","previous_headings":"Daily use of {fusen}","what":"Create a new flat Rmd template","title":"Maintain packages with {fusen}","text":"add new family functions, create new flat Rmd template","code":"add_flat_template(template = \"add\") # or directly add_additional()"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/Maintain-packages-with-fusen.html","id":"how-to-maintain-a-fusen-can-i-use-fusen-with-old-way-packages","dir":"Articles","previous_headings":"","what":"How to maintain a {fusen}? Can I use {fusen} with old-way packages ?","title":"Maintain packages with {fusen}","text":"inflate() “flat_template.Rmd”, code appears twice package. “flat_template.Rmd” correct place package. Take documentation developers. Maintaining package requires choice: Option 1: Modifications added “flat_template.Rmd” file, inflated update packages files Option 2: Modifications realized package files directly package, “flat_template.Rmd” file must deprecated using deprecate_flat_file(). first inflate() may directly work expected R code write. case, can continue implement functionality using Option 1. Advice 1: Use Option 1 find complicated used ! assure , find moment say : ok possible anymore… Advice 2: Use git soon possible, avoid losing work made modifications wrong place Advice 3: Create Readme.Rmd “dev/” directory chunk fusen::draw_package_structure() knit . help understand structure package see inflated . look {fusen} package GitHub see looks like.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/Maintain-packages-with-fusen.html","id":"option-1-continue-with-the-flat_template-rmd","dir":"Articles","previous_headings":"How to maintain a {fusen}? Can I use {fusen} with old-way packages ?","what":"Option 1: Continue with the “flat_template.Rmd”","title":"Maintain packages with {fusen}","text":"(+) encouraged start documenting testing package start coding, generally good practice prototyping. (+) require fully understand package structure files continue building package, continue develop unique file (-) need pay attention checking debugging tools may direct R file directly. requires pay attention always sure modifying code flat template file, inflated. (-) may trouble co-developers already built packages => {fusen} built . modification added dedicated dev_history file inflated => tree structure “dev/Readme.md” file useful understand inflated , see structure package","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/Maintain-packages-with-fusen.html","id":"option-2-maintain-like-a-classical-package","dir":"Articles","previous_headings":"How to maintain a {fusen}? Can I use {fusen} with old-way packages ?","what":"Option 2: Maintain like a classical package","title":"Maintain packages with {fusen}","text":"(+) can use dedicated checking debugging tools , particular RStudio. built direct quickly possible source problem (+) allows collaboration advanced developers used debug package structure directly (-) need remember need care users maintainers, need document test code soon possible, different place code . (-) requires understand structure files package interact , able jump one file , correct folder. may drives lazy continue documenting testing modifications can use deprecate_flat_file() protect original flat template file, never use . Inflated files also unprotected, can modify directly. => way add new functionalities packages started old way, specific cases inflating now complicated, like function inflate() unit tests {fusen} package.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/Maintain-packages-with-fusen.html","id":"what-about-packages-already-built-the-old-way","dir":"Articles","previous_headings":"","what":"What about packages already built the old way ?","title":"Maintain packages with {fusen}","text":"“flat_template.Rmd” template modifies files related functions presented inside template. remove modify previous functions, tests vignettes, provided names different. {fusen} started classical way enough functions able build package . prevent use {fusen} build now ! want modify existing functionalities, need continue maintain already-built package classical way want add new functionalities, correctly documented tested, can use {fusen}. delete previous work. Use “Option 2” continue development functionality","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/Maintain-packages-with-fusen.html","id":"lets-try-to-convince-package-developers-with-an-example","dir":"Articles","previous_headings":"What about packages already built the old way ?","what":"Let’s try to convince package developers with an example","title":"Maintain packages with {fusen}","text":"Install {fusen} : install.packages(\"fusen\") Commit previous state afraid {fusen} confident enough try existing package, create new package following guide “use fusen” Rmd file appears “dev/flat_additional.Rmd”. Open . Write new function function chunk. instance: ’re looking equivalent load_all() functions inside flat file inflating, can use fusen::load_flat_functions() Add corresponding unit test test chunk. instance: run {attachment} behind scene may modify list dependencies DESCRIPTION file accordingly. Use fusen::inflate(flat_file = \"dev/flat_additional.Rmd\", document = FALSE) avoid . also run devtools::check(). Use fusen::inflate(flat_file = \"dev/flat_additional.Rmd\", check = FALSE) avoid . create new vignette package. may want avoid fusen::inflate(flat_file = \"dev/flat_additional.Rmd\", vignette_name = NA) ’s ! added new function package, along example, test new vignette: R/my_median.R tests/testthat/test-my_median.R vignettes/get-started.Rmd","code":"#' My median #' #' @param x Vector of Numeric values #' @inheritParams stats::median #' #' @return #' Median of vector x #' @export #' #' @examples my_median <- function(x, na.rm = TRUE) { if (!is.numeric(x)) { stop(\"x should be numeric\") } stats::median(x, na.rm = na.rm) } my_median(1:12) test_that(\"my_median works properly and show error if needed\", { expect_true(my_median(1:12) == 6.5) expect_error(my_median(\"text\")) })"},{"path":[]},{"path":"https://thinkr-open.github.io/fusen/dev/articles/deal-with-a-fusen-flat-file.html","id":"rename-a-flat-file","dir":"Articles","previous_headings":"","what":"Rename a flat file","title":"Deal with a 'fusen' flat file","text":"‘fusen’ provides function rename_flat_file() rename flat file. function updates file name configuration file, modifies inflating files needed renames flat file . function avoid remaining inflated files repository, ensure configuration file --date.","code":"#' \\dontrun{ # These functions change the current user workspace dev_file <- suppressMessages( add_flat_template( template = \"add\", pkg = \".\", overwrite = TRUE, open = FALSE ) ) rename_flat_file( flat_file = \"dev/flat_additional.Rmd\", new_name = \"flat_new.Rmd\" ) #' }"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/deal-with-a-fusen-flat-file.html","id":"fully-deprecate-a-flat-file-after-inflate","dir":"Articles","previous_headings":"","what":"Fully deprecate a flat file after inflate","title":"Deal with a 'fusen' flat file","text":"‘fusen’ serves framework ensure developers prioritize end-users function development process. employing ‘fusen’ within Rmd/Qmd files, developers can conceptualize product articulate ideas plain text initiating code. approach encourages consideration package’s users: intended actions, potential impact experiences. Consequently, developers can draft function documentation prior implementation, thinking explaining ’s behind black box, well reminding may end vignette. Additionally, ‘fusen’ offers minimal template comprising ‘function’, ‘doc’, ‘test’ components. advocate Test Driven Development (TDD), writing tests precedes function implementation. practice aids function design enables anticipation future behavior. Subsequently, can proceed implement function , thereafter inflating flat file generate R, test, vignette files. initial iteration yields comprehensive documentation, complete test suite, functional implementation. Following initial phase, option : Continue iterating function, documentation, tests within flat file, updating R, test, vignette files accordingly inflation. Opt iterate directly within “R/”, “tests/”, “vignette/” directories. preference transition away flat file conduct development specified directories, proper deprecation flat file recommended. facilitate transition, function deprecate_flat_file() provided. function cleans script files removing “edit” markers, updates ‘fusen’ configuration file, relocates flat file “dev/flat_history/” directory, preserving cleanliness “dev/” directory.","code":"#' \\dontrun{ #' # These functions change the current user workspace dev_file <- suppressMessages( add_flat_template( template = \"add\", pkg = dummypackage, overwrite = TRUE, open = FALSE ) ) deprecate_flat_file(flat_file = \"dev/flat_additional.Rmd\") #' }"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/draw-a-tree-of-your-package-files-and-functions.html","id":"get-a-tree-of-the-package-structure-to-help-developers","dir":"Articles","previous_headings":"","what":"Get a tree of the package structure to help developers","title":"Draw a tree of your package files and functions","text":"get_package_structure() function helps developers understand package structure. reads dev/config_fusen.yaml file, adds list resulting functions extra description files. can know: description flat file issued Title exists flat file still active list R files issued flat file list functions inside R files list files tests issued flat file possibility list functions called test files vignette issued flat file draw_package_structure(), can draw tree package structure console. also works R package, fusen built packages.","code":"#' \\dontrun{ #' # This only works inside a 'fusen' built package #' pkg_structure <- get_package_structure() #' draw_package_structure(pkg_structure) #' } #' #' # Example with a dummy package dummypackage <- tempfile(\"drawpkg.structure\") dir.create(dummypackage) # {fusen} steps fill_description(pkg = dummypackage, fields = list(Title = \"Dummy Package\")) dev_file <- suppressMessages( add_flat_template(pkg = dummypackage, overwrite = TRUE, open = FALSE) ) flat_file <- dev_file[grepl(\"flat_\", dev_file)] usethis::with_project(dummypackage, { # Add an extra R file with internal function # to list in \"keep\" dir.create(\"R\") cat(\"extra_fun <- function() {1}\\n\", file = \"R/my_extra_fun.R\") # Works with classical package pkg_structure <- get_package_structure() draw_package_structure(pkg_structure) }) #> ✔ Setting active project to #> '/tmp/RtmpvIOrAi/drawpkg.structure1a3574320080' #> ── No NAMESPACE file found there: /tmp/RtmpvIOrAi/drawpkg.structure1a3574320080 #> ── keep ──────────────────────────────────────────────────────────────────────── #> #> - keep #> - path #> + keep #> - state #> + 🍏 active #> - R #> - R/my_extra_fun.R #> + 🙈 extra_fun #> - tests #> - vignettes #> ✔ Setting active project to '' usethis::with_project(dummypackage, { # Works with 'fusen' package suppressMessages( inflate( pkg = dummypackage, flat_file = flat_file, vignette_name = \"Get started\", check = FALSE, open_vignette = FALSE ) ) pkg_structure <- get_package_structure() draw_package_structure(pkg_structure) }) #> ✔ Setting active project to #> '/tmp/RtmpvIOrAi/drawpkg.structure1a3574320080' #> ── config file for dev/flat_full.Rmd ─────────────────────────────────────────── #> ── Reading NAMESPACE file ────────────────────────────────────────────────────── #> ── flat_full.Rmd ─────────────────────────────────────────────────────────────── #> ── keep ──────────────────────────────────────────────────────────────────────── #> #> - flat_full.Rmd #> - flat_title #> + flat_full.Rmd for working package #> - path #> + dev/flat_full.Rmd #> - state #> + 🍏 active #> - R #> - R/my_median.R #> + 👀 my_median #> - R/my_other_median.R #> + 👀 my_other_median #> + 🙈 sub_median #> - tests #> + tests/testthat/test-my_median.R #> + tests/testthat/test-my_other_median.R #> - vignettes #> + vignettes/get-started.Rmd #> - keep #> - path #> + keep #> - state #> + 🍏 active #> - R #> - R/my_extra_fun.R #> + 🙈 extra_fun #> - tests #> - vignettes #> ✔ Setting active project to ''"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/draw-a-tree-of-your-package-files-and-functions.html","id":"get-the-list-of-functions-from-a-r-file","dir":"Articles","previous_headings":"","what":"Get the list of functions from a R file","title":"Draw a tree of your package files and functions","text":"","code":"file_path <- tempfile(fileext = \".R\") cat( \"my_fun <- function() {1}\", \"my_fun2 <- function() {2}\", sep = \"\\n\", file = file_path ) get_all_created_funs(file_path) #> [1] \"my_fun\" \"my_fun2\""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/inflate-all-your-flat-files.html","id":"inflate-all-your-flat-files-at-once","dir":"Articles","previous_headings":"","what":"Inflate all your flat files at once","title":"Inflate all your flat files","text":"inflate_all() function allows user inflate active flat files available “dev/” directory . requires inflate new flat file individually least order register inflate parameters. Prior able inflate flat files, checks performed, assess whether flat files available used inflate_all().","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/inflate-all-your-flat-files.html","id":"store-configuration-of-each-flat-file-once","dir":"Articles","previous_headings":"Inflate all your flat files at once","what":"Store configuration of each flat file once","title":"Inflate all your flat files","text":"inflate_all() requires existence complete {fusen} configuration file: “dev/config_fusen.yaml”. file exists versions {fusen} upper v0.5.0: working project initiated version {fusen} prior v0.5.0, please manually run inflate() flat files want work , order create appropriate “dev/config_fusen.yaml” file. already familiar “dev/config_fusen.yaml” working dev version {fusen} prior v0.5.1, “dev/config_fusen.yaml” file contain inflate-related parameters. inflate flat files order complete configuration file proper inflate() parameters.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/inflate-all-your-flat-files.html","id":"prevent-some-flat-files-to-be-inflated","dir":"Articles","previous_headings":"Inflate all your flat files at once","what":"Prevent some flat files to be inflated","title":"Inflate all your flat files","text":"flat file listed configuration file, inflated time run inflate_all(). want flat file inflated anymore, can deprecate . Open configuration file “dev/config_fusen.yaml”. Find section concerning flat file. Change state: active state: deprecated. inflated following calls inflate_all(). may flat file work progress inflated yet. affect flat files inflated. case may see following message. can ignore .","code":"The flat file {flat} is not going to be inflated. It was detected in your flats directory but it is absent from the config file. Please inflate() it manually when you are ready, so that it is accounted the next time."},{"path":"https://thinkr-open.github.io/fusen/dev/articles/inflate-all-your-flat-files.html","id":"wrapper-around-inflate_all","dir":"Articles","previous_headings":"Inflate all your flat files at once","what":"Wrapper around inflate_all()","title":"Inflate all your flat files","text":"wrapper named inflate_all_no_check() prevent running devtools::check(). short version inflate_all(check = FALSE).","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/inflate-all-your-flat-files.html","id":"register-all-other-files-to-help-clean-your-project","dir":"Articles","previous_headings":"Inflate all your flat files at once","what":"Register all other files to help clean your project","title":"Inflate all your flat files","text":"Note also files stored R, tests vignettes directories checked detect created flat file. need registered config file , order help keep package clean deprecated files. inflate_all() thus runs check_not_registered_files() behind scene informs procedure. Read vignette('register-files--config', package = 'fusen') get information.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/inflate-all-your-flat-files.html","id":"complete-the-process-with-your-own-code-style","dir":"Articles","previous_headings":"Inflate all your flat files at once","what":"Complete the process with your own code style","title":"Inflate all your flat files","text":"can run preferred styling functions just check package inflate_all(). instance, want {styler} package clean code inflate process, can run inflate_all(stylers = styler::style_pkg). also like clean “dev/” directory, can run inflate_all(stylers = function() {styler::style_pkg(); styler::style_dir(\"dev\")}).","code":"#' \\dontrun{ # Usually, in the current package run inflate_all() directly # These functions change the current user workspace inflate_all() # Or inflate_all_no_check() to prevent checks to run inflate_all_no_check() # Or inflate with the styler you want inflate_all(stylers = styler::style_pkg) #' } # You can also inflate_all flats of another package as follows # Example with a dummy package with a flat file dummypackage <- tempfile(\"inflateall.otherpkg\") dir.create(dummypackage) fill_description(pkg = dummypackage, fields = list(Title = \"Dummy Package\")) flat_files <- add_minimal_package( pkg = dummypackage, overwrite = TRUE, open = FALSE ) flat_file <- flat_files[grep(\"flat\", basename(flat_files))] # Inflate the flat file once usethis::with_project(dummypackage, { # if you are starting from a brand new package, inflate_all() will crash # it's because of the absence of a fusen config file # # inflate_all() # will crash # Add licence usethis::use_mit_license(\"John Doe\") # you need to inflate manually your flat file first inflate( pkg = dummypackage, flat_file = flat_file, vignette_name = \"Get started\", check = FALSE, open_vignette = FALSE, document = TRUE, overwrite = \"yes\" ) # your config file has been created config_yml_ref <- yaml::read_yaml(getOption(\"fusen.config_file\", default = \"dev/config_fusen.yaml\")) }) # Next time, you can run inflate_all() directly usethis::with_project(dummypackage, { # now you can run inflate_all() inflate_all(check = FALSE, document = TRUE) }) # Clean the temporary directory unlink(dummypackage, recursive = TRUE)"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/register-files-in-config.html","id":"fusen-registers-all-files-of-your-package","dir":"Articles","previous_headings":"","what":"{fusen} registers all files of your package","title":"Register files in config","text":"{fusen} >=0.5, file named “dev/config_fusen.yaml” (default) registers files created specific “flat” file soon inflate . helps keep track link flat files R, tests vignettes files created package. configuration file also register files created flat file. helps keep package clean. know special steps realize version {fusen}, run: Messages function guide transition used old version {fusen}. Chances need : Inflate flat file project one one (least ) version {fusen} Run fusen::check_not_registered_files() Check content “dev/config_not_registered.csv” unregistered files. Clean package useless unregistered files required. Register remaining unregistered files fusen::register_all_to_config() Try fusen::inflate_all_no_check() fusen::inflate_all() good now.Read vignette(\"inflate---flat-files\", package = \"fusen\") know inflate_all().","code":"fusen::inflate_all_no_check()"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/register-files-in-config.html","id":"what-is-the-configuration-file","dir":"Articles","previous_headings":"","what":"What is the configuration file?","title":"Register files in config","text":"configuration file stored “dev/config_fusen.yaml”. lists flat files inflated, along lists files created inflate parameters used inflate. also list files, created flat files, section named “keep”. instance, part configuration file package {fusen} looks like:","code":"flat_addins.Rmd: path: dev/flat_addins.Rmd state: active R: R/build_fusen_chunks.R tests: tests/testthat/test-build_fusen_chunks.R vignettes: [] inflate: flat_file: dev/flat_addins.Rmd vignette_name: .na open_vignette: true check: false document: true overwrite: ask keep: path: keep R: - R/addins.R - R/create_fusen_rsproject.R - R/fusen-package.R - R/globals.R - R/inflate-utils.R - R/load_flat_functions.R - R/utils-pipe.R tests: - tests/testthat/test-create_fusen_rsproject.R - tests/testthat/test-inflate_qmd.R - tests/testthat/test-inflate_utils.R - tests/testthat/test-load_flat_functions.R - tests/testthat/test-skeleton.R vignettes: vignettes/tips-and-tricks.Rmd"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/register-files-in-config.html","id":"what-about-unregistered-files","dir":"Articles","previous_headings":"","what":"What about unregistered files?","title":"Register files in config","text":"Imagine inflated function named my_fun(), decide change name function my_new_fun(). inflate, two files “R/myfun.R” “R/my_new_fun.R” package. However, “R/myfun.R” deleted function exist anymore. unsure files still , can run fusen::check_not_registered_files(). case, “R/myfun.R” appear csv file created “dev/config_not_registered.csv”, message like “Possibly deprecated file”. now possibility detect deprecated files project. Run fusen::check_not_registered_files() often need want clean project. Note function included fusen::inflate_all() fusen::inflate_all_no_check(), let opportunity clean project regularly. able detect deprecated files, legitimate files need registered. Even ones created manually. case, listed \"keep\" section. {fusen} knows bother files.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/register-files-in-config.html","id":"deprecate-flat-files-after-inflate","dir":"Articles","previous_headings":"","what":"Deprecate flat files after inflate","title":"Register files in config","text":"example configuration file , can note “flat_addins.Rmd” section parameter state: active means inflate_all() indeed inflate file. practice {fusen} inflate , continue development R, test vignette files directly, may want properly deprecated flat file. case, recommend store flat file sub-directory named “dev/dev_history/” default behavior future release. , can change flat file state: deprecated configuration file, change path: section file .","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/register-files-in-config.html","id":"detect-all-files-that-are-not-registered-in-configuration-file","dir":"Articles","previous_headings":"","what":"Detect all files that are not registered in configuration file","title":"Register files in config","text":"check_not_registered_files() shows files already registered yaml config file.Note check_not_registered_files() try guess source flat template, used {fusen} >= 0.4 . csv file “dev/config_not_registered.csv” created check_not_registered_files() lists unregistered files. contains three columns: type: type file among R, test vignette path: path find unregistered file flat file detected already appears configuration file, unregistered file probably deprecated file needs deleted. know. flat file detected already configuration file, section flat file created next step register_all_to_config(). source detected, probably means created manually. Decide files want delete. run fusen::register_all_to_config() register remaining files “keep” section. look configuration file end process check everything set properly. Maybe flat files detected state: active state: deprecated. ’re one knows.","code":"#' \\dontrun{ # Run this on the current package in development out_csv <- check_not_registered_files() file.edit(out_csv) #' } # Or you can try on the reproducible example dummypackage <- tempfile(\"clean\") dir.create(dummypackage) # {fusen} steps fill_description(pkg = dummypackage, fields = list(Title = \"Dummy Package\")) dev_file <- suppressMessages(add_flat_template(pkg = dummypackage, overwrite = TRUE, open = FALSE)) flat_file <- dev_file[grepl(\"flat_\", dev_file)] # Inflate once usethis::with_project(dummypackage, { suppressMessages( inflate( pkg = dummypackage, flat_file = flat_file, vignette_name = \"Get started\", check = FALSE, open_vignette = FALSE ) ) # Add a not registered file to the package cat(\"# test R file\\n\", file = file.path(dummypackage, \"R\", \"to_keep.R\")) # Use the function to check the list of files out_csv <- check_not_registered_files(dummypackage) out_csv # Read the csv to see what is going on content_csv <- read.csv(out_csv, stringsAsFactors = FALSE) content_csv # Keep it all or delete some files, and then register all remaining out_config <- register_all_to_config() out_config # Open the out_config file to see what's going on yaml::read_yaml(out_config) }) unlink(dummypackage, recursive = TRUE)"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/register-files-in-config.html","id":"how-register_all_to_config-works","dir":"Articles","previous_headings":"","what":"How register_all_to_config() works","title":"Register files in config","text":"files current state legitimate, , can register everything config file. Run register_all_to_config() current package create “dev/config_fusen.yaml” registers files. note “keep” section, lists files source guessed. function deletes “config_not_registered.csv” created check_not_registered_files().","code":"#' \\dontrun{ # Usually run this one inside the current project # Note: running this will write \"dev/config_fusen.yaml\" in your working directory register_all_to_config() #' } # Or you can try on the reproducible example dummypackage <- tempfile(\"register\") dir.create(dummypackage) # {fusen} steps fill_description(pkg = dummypackage, fields = list(Title = \"Dummy Package\")) dev_file <- suppressMessages(add_flat_template(pkg = dummypackage, overwrite = TRUE, open = FALSE)) flat_file <- dev_file[grepl(\"flat_\", dev_file)] # Inflate once usethis::with_project(dummypackage, { suppressMessages( inflate( pkg = dummypackage, flat_file = flat_file, vignette_name = \"Get started\", check = FALSE, open_vignette = FALSE ) ) out_path <- register_all_to_config(dummypackage) # Look at the output yaml::read_yaml(out_path) })"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/share-on-a-github-website.html","id":"initiate-your-package-and-share-it-on-github","dir":"Articles","previous_headings":"","what":"Initiate your package and share it on GitHub","title":"Share on a GitHub website","text":"Create new project {fusen} using git Follow “dev/0-dev_history.Rmd” describe project least, fill fusen::fill_description() function identity Write code supposed plain markdown Separate function example test chunks Create new sections flat template Addin > add {fusen} chunk Sections transferred correct places get proper package set checks run verify work properly documented tested may need run usethis::create_github_token(), gitcreds::gitcreds_set() , registered GitHub token yet. asked multiple times want commit, can say “yes” time. minutes, ’ll able see share project website. won’t run command line . time push new commits main branch GitHub, website updated thanks GitHub Actions.","code":"# Describe your project fusen::fill_description( pkg = here::here(), fields = list( Title = \"Share Your Project Following Good Development Practices From a Rmarkdown File\", Description = \"Use Rmarkdown First method. Strengthen your work with documentation and tests. Everything can be set from a Rmarkdown file in your project.\", `Authors@R` = c( person(\"John\", \"Doe\", email = \"john@email.me\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0000-0000-0000\")) ) ) ) # Define License with use_*_license() usethis::use_mit_license(\"John Doe\") fusen::inflate(flat_file = \"dev/flat_full.Rmd\", vignette_name = \"Get started\") #' \\dontrun{ #' # This modifies the current directory and send it on GitHub init_share_on_github() #' }"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/share-on-a-github-website.html","id":"what-happens-behind-the-scene","dir":"Articles","previous_headings":"","what":"What happens behind the scene ?","title":"Share on a GitHub website","text":"init_share_on_github() runs multiple steps able share proper package GitHub: Start versionning git already Connect GitHub account update content information deployment Add NEWS file present modifications releases Add README.Rmd knit README.md quickly present aim use package Check package Linux, Windows MacOS Calculate code coverage Init continuous deployment (CD) {pkgdown} website documentation Commit push GitHub List remaining manual steps make website public","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"can-i-be-lazy-in-names-used","dir":"Articles","previous_headings":"","what":"Can I be lazy in names used?","title":"Tips and tricks","text":"function can named fun- fun_ fun-my_function_name example can named ex- ex_ ex-my_function_name tests can named test- test-my_function_name development can named dev- dev_ dev-my_function_name wrappers around add_flat_template() lazy developers: add_additional(), add_full(), add_minimal()","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"can-i-knit-the-content-of-the-flat-template","dir":"Articles","previous_headings":"","what":"Can I knit the content of the flat template ?","title":"Tips and tricks","text":"Yes. Although real goal, flat template can filled run like Rmarkdown file. However, need keep mind transformed R package, requires specific attention. Use development chunk beginning flat template declare packages need explore code Note used anywhere package. development chunk code exploration, development. Remember package structure, examples tests code run independently. Thus, examples tests chunk need code required run independently. development chunk contains inflate() call need eval=FALSE parameter avoid side effects knit flat file.","code":"```{r dev} library(glue) library(stringi) ```"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"how-to-declare-packages-with-library-for-the-future-vignette","dir":"Articles","previous_headings":"","what":"How to declare packages with library() for the future vignette ?","title":"Tips and tricks","text":"use classical chunk, without specific name, copied vignette.","code":"```{r} library(glue) library(stringi) ```"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"how-to-include-examples-that-cannot-be-run","dir":"Articles","previous_headings":"","what":"How to include examples that cannot be run ?","title":"Tips and tricks","text":"created chunk example want example run function example want run vignette. Use eval=FALSE chunk options, wont run vignette Use #' \\dontrun{} syntax, #' examples function example run","code":"```{r function-myfunction} myfunction <- function(x) { x } ``` ```{r example-myfunction, eval=FALSE} # Will be run in example but not in vignette myfunction(10) # Will not be run in example #' \\dontrun{ myfunction(12) #' } #' \\dontrun{ #' myfunction(12) #' } ```"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"document-your-internal-datasets-in-a-function-chunk-as-usual","dir":"Articles","previous_headings":"","what":"Document your internal datasets in a function chunk as usual","title":"Tips and tricks","text":"document datasets, pkgdoc, special R files, can write function chunk. {fusen} detect keyword function() R6Class() function chunk code, chunk copied “R/” file.","code":"```{r function-cars} #' cars #' #' data in 'datasets'. #' #' @format A data frame with 50 rows and 2 variables: #' \\describe{ #' \\item{ speed }{ numeric } #' \\item{ dist }{ numeric } #' } #' @source Ezekiel, M. (1930) Methods of Correlation Analysis. Wiley. \"cars\" ```"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"how-to-ignore-some-chunks","dir":"Articles","previous_headings":"","what":"How to ignore some chunks ?","title":"Tips and tricks","text":"chunks named dev development used package. Use exploration want keep end process. won’t affect package.","code":"```{r dev} # Some code exploration ```"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"how-to-create-a-vignette-with-different-title-and-index-entry","dir":"Articles","previous_headings":"","what":"How to create a vignette with different title and Index Entry?","title":"Tips and tricks","text":"can use inflate(vignette_name = c(\"Super title\" = \"01-Super Slug\")) vignette title different vignette Entry","code":"inflate(vignette_name = c(\"Super title\" = \"01-Super Vignette Index Entry\"))"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"how-not-to-create-a-vignette","dir":"Articles","previous_headings":"","what":"How not to create a vignette?","title":"Tips and tricks","text":"build internal functions, may want inflate flat file vignette. flat file developer’s documentation may enough","code":"inflate(vignette_name = NA)"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"how-to-get-a-pre-filled-template-for-a-specific-function-name","dir":"Articles","previous_headings":"","what":"How to get a pre-filled template for a specific function name ?","title":"Tips and tricks","text":"first function flat template: can create template add_flat_template(\"minimal\", flat_name = \"my_function_name\"). case, template pre-filled function name: chunk names, function calls. can also use RStudio Addin “Add {fusen} flat template” create new template “dev/” directory. prompt template type function name second function inside existing template: Position prompt want add new function use RStudio Addin: “Add {fusen} chunks”. asked function name. Addin uses add_fusen_chunks(\"my_function_name\")","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"how-to-pre-fill-multiple-functions-in-one-template","dir":"Articles","previous_headings":"How to get a pre-filled template for a specific function name ?","what":"How to pre-fill multiple functions in one template","title":"Tips and tricks","text":"can added “dev_history.Rmd”, replace place holder flat rmd (case) proper fusen chunks future functions . Add line flat file","code":"# Path of the flat file path_flat_rmd <- here::here(\"dev/flat_minimal.Rmd\") # Name of future functions to add - example fun_nms <- c( \"get_contract_by_country_of\", \"get_contract_subsidies_of\", \"get_contract_effort_of\", \"get_contract_fees_of\", \"get_contract_target_countries_of\", \"get_contract_all_info_of\" ) # Create content l_chunks <- purrr::map_chr(fun_nms, fusen:::build_fusen_chunks) chunks <- paste(l_chunks, collapse = \"\") # Add in the flat file flat_rmd <- readLines(path_flat_rmd) flat_rmd <- sub(\"^HERE$\", chunks, flat_rmd) writeLines(flat_rmd, path_flat_rmd)"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"how-to-inflate-multiple-flat-files","dir":"Articles","previous_headings":"","what":"How to inflate multiple flat files ?","title":"Tips and tricks","text":"Use inflate_all() Read dedicated vignette “inflate---flat-files”","code":"vignette(\"inflate-all-your-flat-files\", package = \"fusen\")"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"how-to-store-multiple-functions-in-a-unique-r-file","dir":"Articles","previous_headings":"","what":"How to store multiple functions in a unique R file ?","title":"Tips and tricks","text":"multiple ways . Choose one : use section title structure, use roxygen tags use chunk parameter.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"all-functions-under-one-title-section","dir":"Articles","previous_headings":"How to store multiple functions in a unique R file ?","what":"All functions under one title section","title":"Tips and tricks","text":"Use 3-set chunks (fun, example, test) twice, title section Rmd","code":"# One title for both groups of chunk The code and tests for the first function ```{r function-fun1} ``` ```{r example-fun1} ``` ```{r test-fun1} ``` The code and tests for the second function ```{r function-fun2} ``` ```{r example-fun2} ``` ```{r test-fun2} ```"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"use-same-rdname-in-function-roxygen","dir":"Articles","previous_headings":"How to store multiple functions in a unique R file ?","what":"Use same @rdname in function roxygen","title":"Tips and tricks","text":"","code":"# Title 1 for function 1 ```{r function-fun_rdname1} #' My fun_rdname1 #' #' @param x Vector of Numeric values #' @inheritParams stats::median #' #' @rdname same_rdname #' @return #' Median of vector x #' @export #' #' @examples #' my_fun_rdname1(2:20) my_fun_rdname1 <- function(x, na.rm = TRUE) { if (!is.numeric(x)) { stop(\"x should be numeric\") } stats::median(x, na.rm = na.rm) } ``` # Title 2 for function 2 ```{r function-fun_rdname2} #' My fun_rdname2 #' #' @param x Vector of Numeric values #' @inheritParams stats::median #' #' @rdname same_rdname #' @return #' Median of vector x #' @export #' #' @examples #' my_fun_rdname2(2:20) my_fun_rdname2 <- function(x, na.rm = TRUE) { if (!is.numeric(x)) { stop(\"x should be numeric\") } stats::median(x, na.rm = na.rm) } ```"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"use-same-filename-in-function-roxygen","dir":"Articles","previous_headings":"How to store multiple functions in a unique R file ?","what":"Use same @filename in function roxygen","title":"Tips and tricks","text":"@filename recognized {fusen} proper roxygen tag merge multiple functions “R/” “tests/” files. code line removed resulting “R/” files avoid interference Roxygenize.","code":"# Title 1 for function 1 ```{r function-fun_filename1} #' My fun_filename1 #' #' @param x Vector of Numeric values #' @inheritParams stats::median #' #' @filename same_filename #' @return #' Median of vector x #' @export #' #' @examples #' my_fun_filename1(2:20) my_fun_filename1 <- function(x, na.rm = TRUE) { if (!is.numeric(x)) { stop(\"x should be numeric\") } stats::median(x, na.rm = na.rm) } ``` # Title 2 for function 2 ```{r function-fun_filename2} #' My fun_filename2 #' #' @param x Vector of Numeric values #' @inheritParams stats::median #' #' @filename same_filename #' @return #' Median of vector x #' @export #' #' @examples #' my_fun_filename2(2:20) my_fun_filename2 <- function(x, na.rm = TRUE) { if (!is.numeric(x)) { stop(\"x should be numeric\") } stats::median(x, na.rm = na.rm) } ```"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"use-chunk-param-filename-the_comon_filename","dir":"Articles","previous_headings":"How to store multiple functions in a unique R file ?","what":"Use chunk param filename = \"the_comon_filename\"","title":"Tips and tricks","text":"Add function chunk ","code":"# Title 1 for function 1 ```{r function-fun_chunk1, filename = \"fun_chunk1\"} #' The code of your function 1 ``` ```{r example-fun_chunk1} ``` ```{r test-fun_chunk1} ``` # Title 2 for function 2 ```{r function-fun_chunk2, filename = \"fun_chunk1\"} #' The code of your function 2 ``` ```{r example-fun_chunk2} ``` ```{r test-fun_chunk2} ```"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"how-to-read-dataset-that-i-usually-put-in-teststestthat-for-my-unit-tests","dir":"Articles","previous_headings":"","what":"How to read dataset that I usually put in “tests/testthat/” for my unit tests?","title":"Tips and tricks","text":"checks, tests run relative “tests/testthat/” directory. need anticipate two ways reading data: One within flat file, needs modified One use future test file","code":"# The path relative to the \"tests/testthat\" directory for tests the_file <- \"my_file.csv\" if (!file.exists(the_file)) { # The path to use during dev in the flat file the_file <- file.path(\"tests\", \"testthat\", the_file) if (!file.exists(the_file)) { stop(the_file, \" does not exist\") } } my_file <- read.csv(the_file)"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"can-i-load-all-functions-of-the-current-flat-file-during-development-without-having-to-inflate","dir":"Articles","previous_headings":"","what":"Can I load all functions of the current flat file during development without having to inflate()?","title":"Tips and tricks","text":"Yes. can run load function chunks currently opened flat file load_flat_functions(). long flat file currently development, inflate(), sometimes difficult run chunks needed multiple modifications. can also useful start development day . load_flat_functions() like load_all() flat file, although account dependencies. console, run: can also run function chunks specific flat file :","code":"fusen::load_flat_functions() fusen::load_flat_functions(flat_file = \"dev/flat_full.Rmd\")"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"can-i-inflate-a-quarto-qmd-file","dir":"Articles","previous_headings":"","what":"Can I inflate a Quarto qmd file?","title":"Tips and tricks","text":"Yes can. long include qmd flat file good R package vignette, can use qmd format. really change output anything flat file meant rendered. vignette created flat file still Rmd file. !? Hence, can add flat file change extension “.qmd” like.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"can-i-use-fusen-with-golem","dir":"Articles","previous_headings":"","what":"Can I use {fusen} with {golem}?","title":"Tips and tricks","text":"course ! even recommended allows properly separate business logic (“dev/” directory) UI (modules “R/” directory). Start creating {golem} project. can start adding flat files. recommend create modules names relation flat files, can better navigate project. Although default {golem} “dev/” files already contain main actions maintain package, can still add “0-dev_history.Rmd” file recommended {fusen} using add_dev_history(). Note sections redundant {golem} dev files.","code":"golem::create_golem('my.golem.app') fusen::add_minimal_flat(flat_name = \"page1\") golem::add_module(name = \"page1\")"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"how-can-i-know-if-r-files-were-created-from-a-flat-or-not","dir":"Articles","previous_headings":"","what":"How can I know if R files were created from a flat or not ?","title":"Tips and tricks","text":"can draw structure package `fusen:::draw_package_structure(). Read vignette “Draw tree package files functions”” details.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Sebastien Rochette. Author, maintainer. ThinkR. Copyright holder.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Rochette S (2024). fusen: Build Package Rmarkdown Files. R package version 0.6.0.9000, https://github.com/Thinkr-open/fusen, https://thinkr-open.github.io/fusen/.","code":"@Manual{, title = {fusen: Build a Package from Rmarkdown Files}, author = {Sebastien Rochette}, year = {2024}, note = {R package version 0.6.0.9000, https://github.com/Thinkr-open/fusen}, url = {https://thinkr-open.github.io/fusen/}, }"},{"path":"https://thinkr-open.github.io/fusen/dev/index.html","id":"fusen-","dir":"","previous_headings":"","what":"Build a Package from Rmarkdown Files","title":"Build a Package from Rmarkdown Files","text":"{fusen} inflates Rmarkdown file magically create package. know create Rmarkdown file, know build package. Fill flat Rmd (qmd) template everything one place {fusen} inflate identified parts correct package files directories. {fusen} Rmarkdown template encourages users fill documentation tests time writing functions code. Thanks R package structure used {fusen}, can build robust workflow R package. {fusen} simplifies reduces number steps towards full R package. , {pkgdown} documentation website one command away shared users. {fusen} package real-world example {fusen} use created flat templates available \"dev/\" folder GitHub repository. can look architecture Readme “dev” directory.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Build a Package from Rmarkdown Files","text":"can install released CRAN version: Full documentation CRAN version : https://thinkr-open.github.io/fusen/ can install development version {fusen} r-universe GitHub: Full documentation development version : https://thinkr-open.github.io/fusen/dev/","code":"install.packages(\"fusen\") # From r-universe.dev (No need for GITHUB_PAT) install.packages(\"fusen\", repos = c(\"https://thinkr-open.r-universe.dev\", \"https://cloud.r-project.org\")) # Or with {pak} using GitHub API - Need for GITHUB_PAT # install.packages(\"pak\") pak::pak(\"ThinkR-open/fusen\")"},{"path":"https://thinkr-open.github.io/fusen/dev/index.html","id":"you-are-one-rmd-away-from-building-a-package","dir":"","previous_headings":"","what":"You are one Rmd away from building a package!","title":"Build a Package from Rmarkdown Files","text":"{fusen} correctly separating naming chunks. RStudio template: File > New Project > New directory > Package using {fusen} Choose template teaching first time see {fusen} works, Choose template full second time answer questions command line: create_fusen(\"path//new/project\", template = \"teaching\") Open “dev/flat_teaching.Rmd” start setting package look like lines code: probably develop examples tests first time, can let code , already content working package open vignette created Share website GitHub ’s ! built package! documented tested package!even website ! Let’s test now: Install package locally can restart RStudio session let appear “Build” tab panel Test functions package","code":"fill_description(fields = list(Title = \"My Awesome Package\")) usethis::use_mit_license(\"John Doe\") fusen::inflate( flat_file = \"dev/flat_teaching.Rmd\", vignette_name = \"Get started\", check = TRUE ) fusen::init_share_on_github() remotes::install_local() my.package::my_median(1:12)"},{"path":"https://thinkr-open.github.io/fusen/dev/index.html","id":"description-of-the-rmd-template","dir":"","previous_headings":"","what":"Description of the Rmd template","title":"Build a Package from Rmarkdown Files","text":"said earlier, using correct split name chunks. Chunk named function gets code function chunk names unique future vignette, can add function names like example-myfunction, example-myotherfunction, … Chunk named tests gets code unit testing Chunk named development gets code development purposes, usually used like {usethis} functions Inflate flat Rmd template transform package functions, unit tests current Rmd transformed vignette. check. Note \"flat*.Rmd\" files created templates full teaching indeed working examples can directly inflated. can also look {squirrels.fusen} built present method. Follow commits: https://github.com/statnmap/squirrels.fusen/commits/main","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/index.html","id":"how-to-maintain-a-fusen-can-i-use-fusen-with-old-way-packages","dir":"","previous_headings":"","what":"How to maintain a {fusen}? Can I use {fusen} with old-way packages?","title":"Build a Package from Rmarkdown Files","text":"dedicated vignette answer : https://thinkr-open.github.io/fusen/articles/Maintain-packages--fusen.html Option 1: first inflate flat file, can continue developing “flat_template.Rmd” file, inflate using fusen::inflate_all() Option 2: ’re done inflating, can decide deprecate flat file fusen::deprecate_flat_file() develop package files directly, R package. ‘fusen’ impact structure classical package inflated. Advice: Use git soon possible, avoid losing work made modifications wrong place Advice: Show package structure fusen::draw_package_structure() “dev/Readme.md” file help developers","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/index.html","id":"who-is-fusen-for","dir":"","previous_headings":"","what":"Who is {fusen} for?","title":"Build a Package from Rmarkdown Files","text":"mind documentation users tests maintainers, {fusen} . Start writing documentation tests conceive functionalities, directly available users maintainers. Indeed, write Rmarkdown file (vignette), create documentation analysis (package). write functions, check functions examples maybe write unit tests verify outputs. even true follow guide : ‘Rmd first’: development starts documentation Write file explore possibilities let {fusen} store right place ! {fusen} first addressed people never wrote package know write Rmarkdown file. Understanding package infrastructure correctly settling can frightening. package may help first step! {fusen} also addressed advanced developers care users sustainability products, fed switching R files, tests files, vignettes prototype functions. particular, changing arguments function, need change examples, unit tests multiple places. , can one place. risk forget one. Think also code review: everything related one function place.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/index.html","id":"qa--all-tips-and-tricks-of-a-fusen-template","dir":"","previous_headings":"","what":"Q&A : All tips and tricks of a {fusen} template","title":"Build a Package from Rmarkdown Files","text":"Can lazy names used? Can knit content flat template ? declare packages library() future vignette ? include examples run ? Document internal datasets function chunk usual ignore chunks ? create vignette different title Index Entry? create vignette ? get pre-filled template specific function name ? inflate multiple flat files ? store multiple functions unique R file ? read dataset usually put “tests/testthat/” unit tests? Can load functions current flat file development without inflate()? Can inflate Quarto qmd file? Can use {fusen} {golem}? can know R files created flat ? => See vignette Tips Tricks: https://thinkr-open.github.io/fusen/articles/tips--tricks.html","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/index.html","id":"why-is-this-package-named-fusen-","dir":"","previous_headings":"","what":"Why is this package named {fusen} ?","title":"Build a Package from Rmarkdown Files","text":"fusen origami. flat piece paper fold specific way end, can magically inflate let nice box appear. Similarly, {fusen} package uses flat Rmd template, fill specific way end, can magically inflate() let nice package appear.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/index.html","id":"contributing","dir":"","previous_headings":"","what":"Contributing","title":"Build a Package from Rmarkdown Files","text":"‘fusen’ partially built using ‘fusen’ . ’re sure contribute using ‘fusen’, can contribute package: package made help ‘fusen’ exactly structure classical package. Knowing , want contribute ‘fusen’, can follow instructions CONTRIBUTING.md file.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/index.html","id":"acknowledgments","dir":"","previous_headings":"","what":"Acknowledgments","title":"Build a Package from Rmarkdown Files","text":"Thanks Deemah asked go ‘Rmd first’ presentation useR 2019 Toulouse: ‘“Rmd first” method: projects start documentation’ (Video Youtube: https://youtu./cB1BCxFbhtk). Now replaced {lightparser} : https://github.com/ThinkR-open/lightparser Thanks ThinkR team adopted package daily production.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/index.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Build a Package from Rmarkdown Files","text":"Please note {fusen} project released Contributor Code Conduct. contributing project, agree abide terms.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/add_flat_template.html","id":null,"dir":"Reference","previous_headings":"","what":"Add flat Rmd file that drives package development — add_additional","title":"Add flat Rmd file that drives package development — add_additional","text":"Add flat Rmd file drives package development","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/add_flat_template.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add flat Rmd file that drives package development — add_additional","text":"","code":"add_additional( pkg = \".\", dev_dir = \"dev\", flat_name = \"additional\", overwrite = FALSE, open = TRUE ) add_minimal_flat( pkg = \".\", dev_dir = \"dev\", flat_name = \"minimal\", overwrite = FALSE, open = TRUE ) add_minimal_package( pkg = \".\", dev_dir = \"dev\", flat_name = \"minimal\", overwrite = FALSE, open = TRUE ) add_full( pkg = \".\", dev_dir = \"dev\", flat_name = \"full\", overwrite = FALSE, open = TRUE ) add_dev_history(pkg = \".\", dev_dir = \"dev\", overwrite = FALSE, open = TRUE) add_flat_template( template = c(\"full\", \"minimal_package\", \"minimal_flat\", \"additional\", \"teaching\", \"dev_history\"), pkg = \".\", dev_dir = \"dev\", flat_name = NULL, overwrite = FALSE, open = TRUE )"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/add_flat_template.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add flat Rmd file that drives package development — add_additional","text":"pkg Path save file dev_dir Name directory development Rmarkdown files. Default \"dev\". flat_name Name file write dev. Use name main function template get chunks pre-filled function name. overwrite Whether overwrite existing flat Rmd template file name open Logical. Whether open file creation template Name template use. See details.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/add_flat_template.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add flat Rmd file that drives package development — add_additional","text":"Create flat Rmd file(s) template(s) return () path","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/add_flat_template.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add flat Rmd file that drives package development — add_additional","text":"Choose template among different templates available: \"full\": full template reproducible package can directly inflated. comes along \"dev_history\" template. Default. \"minimal_package\": Minimal template start new package already know 'fusen', along \"dev_history\" template. Note called \"minimal\" create_fusen(). \"minimal_flat\" \"additional\": Template new minimal flat file . \"teaching\": Template reproducible package, simpler \"full\", everything teach minimal structure package. \"dev_history\": Template functions commonly used package development. contain chunks write functions. Abbreviated names can also used different templates: \"add\" additional, \"minflat\" minimal_flat, \"minpkg\" minimal_package \"teach\" teaching, \"dev\" \"dev_history\". add_additional(), add_minimal_flat(), add_dev_history(), add_minimal_package(), add_full() wrapper around add_flat_template(\"additional\"), ...","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/add_flat_template.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add flat Rmd file that drives package development — add_additional","text":"","code":"# Create a new project dummypackage <- tempfile(\"dummy.package.flat\") dir.create(dummypackage) # Add add_flat_template(template = \"teaching\", pkg = dummypackage) #> Created file .here in /tmp/RtmporxLlS/dummy.package.flat187f1dbe7453 . Please start a new R session in the new project directory. #> [1] \"/tmp/RtmporxLlS/dummy.package.flat187f1dbe7453/dev/flat_teaching.Rmd\" # Delete dummy package unlink(dummypackage, recursive = TRUE) # For classical use in your package if (FALSE) { # first time ever using 'fusen' add_flat_template(\"full\") # first time in your new package add_flat_template(\"minimal_package\") # add new flat file for new functions add_flat_template(\"add\") add_additional() add_minimal_flat() # add only the dev_history file in an existing package add_dev_history() # add new flat template for teaching (a reduced full template) add_flat_template(\"teaching\") }"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/add_fusen_chunks.html","id":null,"dir":"Reference","previous_headings":"","what":"Add 'fusen' chunks — add_fusen_chunks","title":"Add 'fusen' chunks — add_fusen_chunks","text":"Create 'fusen' chunks inside Rmd","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/add_fusen_chunks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add 'fusen' chunks — add_fusen_chunks","text":"","code":"add_fusen_chunks( function_name = NULL, export = getOption(\"fusen.export.functions\") )"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/add_fusen_chunks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add 'fusen' chunks — add_fusen_chunks","text":"function_name Name function create. NULL ( default), user prompted enter . export function exported? Default getOption(\"fusen.export.functions\"). NULL, user prompted enter .","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/add_fusen_chunks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add 'fusen' chunks — add_fusen_chunks","text":"list context content, invisibly.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/add_fusen_chunks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add 'fusen' chunks — add_fusen_chunks","text":"","code":"if (FALSE) { add_fusen_chunks(\"this\", export = TRUE) }"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/check_not_registered_files.html","id":null,"dir":"Reference","previous_headings":"","what":"Show in a table files that are not already registered in the yaml config file — check_not_registered_files","title":"Show in a table files that are not already registered in the yaml config file — check_not_registered_files","text":"user start package without 'fusen' version < 0.4, need create config file, already existing functions.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/check_not_registered_files.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Show in a table files that are not already registered in the yaml config file — check_not_registered_files","text":"","code":"check_not_registered_files( path = \".\", config_file, guess = TRUE, to_csv = TRUE, open = FALSE )"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/check_not_registered_files.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Show in a table files that are not already registered in the yaml config file — check_not_registered_files","text":"path Path package check registered files config_file Path configuration file guess Logical. Guess file inflated specific flat file to_csv Logical. Whether store along config file, outputs csv user clean manually open Logical. Whether open csv unregistered files.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/check_not_registered_files.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Show in a table files that are not already registered in the yaml config file — check_not_registered_files","text":"Path csv file to_csv TRUE. dput() dataframe otherwise.","code":""},{"path":[]},{"path":"https://thinkr-open.github.io/fusen/dev/reference/check_not_registered_files.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Show in a table files that are not already registered in the yaml config file — check_not_registered_files","text":"","code":"if (FALSE) { # Run this on the current package in development out_csv <- check_not_registered_files() file.edit(out_csv) } # Or you can try on the reproducible example dummypackage <- tempfile(\"clean\") dir.create(dummypackage) # {fusen} steps fill_description(pkg = dummypackage, fields = list(Title = \"Dummy Package\")) dev_file <- suppressMessages(add_flat_template(pkg = dummypackage, overwrite = TRUE, open = FALSE)) flat_file <- dev_file[grepl(\"flat_\", dev_file)] # Inflate once usethis::with_project(dummypackage, { suppressMessages( inflate( pkg = dummypackage, flat_file = flat_file, vignette_name = \"Get started\", check = FALSE, open_vignette = FALSE ) ) # Add a not registered file to the package cat(\"# test R file\\n\", file = file.path(dummypackage, \"R\", \"to_keep.R\")) # Use the function to check the list of files out_csv <- check_not_registered_files(dummypackage) out_csv # Read the csv to see what is going on content_csv <- read.csv(out_csv, stringsAsFactors = FALSE) content_csv # Keep it all or delete some files, and then register all remaining out_config <- register_all_to_config() out_config # Open the out_config file to see what's going on yaml::read_yaml(out_config) }) #> ✔ Setting active project to '/tmp/RtmporxLlS/clean187f6dec18c1' #> ── config file for dev/flat_full.Rmd ─────────────────────────────────────────── #> ℹ Some files in your package are not registered in the configuration file stored in dev/config_fusen.yaml: R/to_keep.R #> fusen uses a configuration file to store the structure of your package and help you clean it when needed. #> You will find a list of unregistered files there: csv_file that you can open with `file.edit('dev/config_not_registered.csv')` #> #> Delete unregistered files that you do not need anymore. Then run `fusen::register_all_to_config()`. #> After that, this message should not appear in your next `fusen::check_not_registered_files()` or `fusen::inflate_all()` calls. #> For more information, read `vignette('register-files-in-config (`vignette(fusen::register-files-in-config)`)', package = 'fusen')` #> cli-147-230 #> ✔ R: R/to_keep.R was added to the config file #> ── Delete dev/config_not_registered.csv ──────────────────────────────────────── #> ✔ Setting active project to '' #> $flat_full.Rmd #> $flat_full.Rmd$path #> [1] \"dev/flat_full.Rmd\" #> #> $flat_full.Rmd$state #> [1] \"active\" #> #> $flat_full.Rmd$R #> [1] \"R/my_median.R\" \"R/my_other_median.R\" #> #> $flat_full.Rmd$tests #> [1] \"tests/testthat/test-my_median.R\" #> [2] \"tests/testthat/test-my_other_median.R\" #> #> $flat_full.Rmd$vignettes #> [1] \"vignettes/get-started.Rmd\" #> #> $flat_full.Rmd$inflate #> $flat_full.Rmd$inflate$flat_file #> [1] \"dev/flat_full.Rmd\" #> #> $flat_full.Rmd$inflate$vignette_name #> [1] \"Get started\" #> #> $flat_full.Rmd$inflate$open_vignette #> [1] FALSE #> #> $flat_full.Rmd$inflate$check #> [1] FALSE #> #> $flat_full.Rmd$inflate$document #> [1] TRUE #> #> $flat_full.Rmd$inflate$overwrite #> [1] \"ask\" #> #> $flat_full.Rmd$inflate$clean #> [1] \"ask\" #> #> #> #> $keep #> $keep$path #> [1] \"keep\" #> #> $keep$state #> [1] \"active\" #> #> $keep$R #> [1] \"R/to_keep.R\" #> #> $keep$tests #> list() #> #> $keep$vignettes #> list() #> #> unlink(dummypackage, recursive = TRUE)"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/create_fusen.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a new fusen project — create_fusen","title":"Create a new fusen project — create_fusen","text":"Create new fusen project","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/create_fusen.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a new fusen project — create_fusen","text":"","code":"create_fusen( path, template = c(\"full\", \"minimal\", \"teaching\", \"dev_history\"), flat_name = template, open = TRUE, overwrite = FALSE, with_git = FALSE )"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/create_fusen.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a new fusen project — create_fusen","text":"path Character. Path create new fusen project. template Character. Name template used among \"full\", \"minimal\", \"teaching\" \"dev_history\". flat_name Character. Filename flat file created. also used name first function file minimal template. open Logical. newly created project opened ? overwrite Logical. Allow overwrite 'dev/' files path exists. with_git Logical. git initialized newly created project ?","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/create_fusen.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a new fusen project — create_fusen","text":"Path dev flat files. Side-effect: Create new directory build package","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/create_fusen.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a new fusen project — create_fusen","text":"See add_flat_template details different options template. Template \"additional\" available meant used already existing 'fusen'.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/create_fusen.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a new fusen project — create_fusen","text":"","code":"my_path <- tempfile(\"mypkg\") create_fusen(path = my_path, template = \"full\", open = FALSE) #> ── Creating new directory: /tmp/RtmporxLlS/mypkg187f61bcd954 ─────────────────── #> ✔ Creating '/tmp/RtmporxLlS/mypkg187f61bcd954/' #> ✔ Setting active project to '/tmp/RtmporxLlS/mypkg187f61bcd954' #> ✔ Creating 'R/' #> ✔ Writing a sentinel file '.here' #> • Build robust paths within your project via `here::here()` #> • Learn more at #> ✔ Setting active project to '' #> ✔ New directory created: /tmp/RtmporxLlS/mypkg187f61bcd954 #> ✔ Added /tmp/RtmporxLlS/mypkg187f61bcd954/dev/flat_full.Rmd, /tmp/RtmporxLlS/mypkg187f61bcd954/dev/0-dev_history.Rmd"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/deprecate_flat_file.html","id":null,"dir":"Reference","previous_headings":"","what":"Deprecate a flat file — deprecate_flat_file","title":"Deprecate a flat file — deprecate_flat_file","text":"inflated [inflate_all()] identified deprecated config file. Previously generated files get \"edit hand\" message removed. flat file moved \"dev/flat_history\".","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/deprecate_flat_file.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Deprecate a flat file — deprecate_flat_file","text":"","code":"deprecate_flat_file(flat_file)"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/deprecate_flat_file.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Deprecate a flat file — deprecate_flat_file","text":"flat_file Path flat file deprecate","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/deprecate_flat_file.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Deprecate a flat file — deprecate_flat_file","text":"Used side effect. Move flat file \"dev/flat_history\", update config file, remove \"edit hand\" message.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/deprecate_flat_file.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Deprecate a flat file — deprecate_flat_file","text":"","code":"if (FALSE) { # These functions change the current user workspace dev_file <- suppressMessages( add_flat_template( template = \"add\", pkg = dummypackage, overwrite = TRUE, open = FALSE ) ) deprecate_flat_file(flat_file = \"dev/flat_additional.Rmd\") }"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/fill_description.html","id":null,"dir":"Reference","previous_headings":"","what":"Fill DESCRIPTION file of the package — fill_description","title":"Fill DESCRIPTION file of the package — fill_description","text":"Fill DESCRIPTION file package","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/fill_description.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fill DESCRIPTION file of the package — fill_description","text":"","code":"fill_description(pkg = \".\", fields, overwrite = FALSE)"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/fill_description.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fill DESCRIPTION file of the package — fill_description","text":"pkg Path package fields named list fields add DESCRIPTION, potentially overriding default values. See use_description can set personalized defaults using package options overwrite Whether overwrite existing DESCRIPTION","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/fill_description.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fill DESCRIPTION file of the package — fill_description","text":"Fill DESCRIPTION file fields. Return path file.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/fill_description.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fill DESCRIPTION file of the package — fill_description","text":"","code":"# Create a new project dummypackage <- tempfile(\"dummy.package.desc\") dir.create(dummypackage) fill_description( pkg = dummypackage, fields = list( Title = \"Build A Package From Rmarkdown file\", Description = paste( \"Use Rmd First method to build your package.\", \"Start your package with documentation.\", \"Everything can be set from a Rmarkdown file in your project.\" ), `Authors@R` = c( person(\"John\", \"Doe\", email = \"john@email.me\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0000-0000-0000\") ) ) ) ) #> ! Title was modified to 'Title Case'. # Delete dummy package unlink(dummypackage, recursive = TRUE)"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/fusen-package.html","id":null,"dir":"Reference","previous_headings":"","what":"fusen: Build a Package from Rmarkdown Files — fusen-package","title":"fusen: Build a Package from Rmarkdown Files — fusen-package","text":"Use Rmarkdown First method build package. Start package documentation, functions, examples tests unique file. Everything can set Rmarkdown template file provided project, inflated package. Inflating template copies relevant chunks sections appropriate files required package development.","code":""},{"path":[]},{"path":"https://thinkr-open.github.io/fusen/dev/reference/fusen-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"fusen: Build a Package from Rmarkdown Files — fusen-package","text":"Maintainer: Sebastien Rochette sebastienrochettefr@gmail.com (ORCID) contributors: ThinkR [copyright holder]","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/get_all_created_funs.html","id":null,"dir":"Reference","previous_headings":"","what":"Get all functions created in a R file — get_all_created_funs","title":"Get all functions created in a R file — get_all_created_funs","text":"Get functions created R file","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/get_all_created_funs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get all functions created in a R file — get_all_created_funs","text":"","code":"get_all_created_funs(file)"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/get_all_created_funs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get all functions created in a R file — get_all_created_funs","text":"file R file","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/get_all_created_funs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get all functions created in a R file — get_all_created_funs","text":"character vector function names","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/get_all_created_funs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get all functions created in a R file — get_all_created_funs","text":"","code":"file_path <- tempfile(fileext = \".R\") cat( \"my_fun <- function() {1}\", \"my_fun2 <- function() {2}\", sep = \"\\n\", file = file_path ) get_all_created_funs(file_path) #> [1] \"my_fun\" \"my_fun2\""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/get_package_structure.html","id":null,"dir":"Reference","previous_headings":"","what":"Get structure and information of a 'fusen' built package for developers — get_package_structure","title":"Get structure and information of a 'fusen' built package for developers — get_package_structure","text":"Get structure information 'fusen' built package developers Draw tree package structure console","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/get_package_structure.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get structure and information of a 'fusen' built package for developers — get_package_structure","text":"","code":"get_package_structure(config_file, emoji = TRUE, silent = FALSE) draw_package_structure(structure_list, silent = FALSE)"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/get_package_structure.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get structure and information of a 'fusen' built package for developers — get_package_structure","text":"config_file Path source configuration file get structure emoji Add emojis output silent Whether print messages structure_list list information package issued [get_package_structure()]","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/get_package_structure.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get structure and information of a 'fusen' built package for developers — get_package_structure","text":"list information package","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/get_package_structure.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get structure and information of a 'fusen' built package for developers — get_package_structure","text":"","code":"if (FALSE) { # This only works inside a 'fusen' built package pkg_structure <- get_package_structure() draw_package_structure(pkg_structure) } # Example with a dummy package dummypackage <- tempfile(\"drawpkg.structure\") dir.create(dummypackage) # {fusen} steps fill_description(pkg = dummypackage, fields = list(Title = \"Dummy Package\")) dev_file <- suppressMessages( add_flat_template(pkg = dummypackage, overwrite = TRUE, open = FALSE) ) flat_file <- dev_file[grepl(\"flat_\", dev_file)] usethis::with_project(dummypackage, { # Add an extra R file with internal function # to list in \"keep\" dir.create(\"R\") cat(\"extra_fun <- function() {1}\\n\", file = \"R/my_extra_fun.R\") # Works with classical package pkg_structure <- get_package_structure() draw_package_structure(pkg_structure) }) #> ✔ Setting active project to '/tmp/RtmporxLlS/drawpkg.structure187f7a690980' #> ── No NAMESPACE file found there: /tmp/RtmporxLlS/drawpkg.structure187f7a690980 #> ── keep ──────────────────────────────────────────────────────────────────────── #> #> - keep #> - path #> + keep #> - state #> + 🍏 active #> - R #> - R/my_extra_fun.R #> + 🙈 extra_fun #> - tests #> - vignettes #> ✔ Setting active project to '' usethis::with_project(dummypackage, { # Works with 'fusen' package suppressMessages( inflate( pkg = dummypackage, flat_file = flat_file, vignette_name = \"Get started\", check = FALSE, open_vignette = FALSE ) ) pkg_structure <- get_package_structure() draw_package_structure(pkg_structure) }) #> ✔ Setting active project to '/tmp/RtmporxLlS/drawpkg.structure187f7a690980' #> ── config file for dev/flat_full.Rmd ─────────────────────────────────────────── #> ── Reading NAMESPACE file ────────────────────────────────────────────────────── #> ── flat_full.Rmd ─────────────────────────────────────────────────────────────── #> ── keep ──────────────────────────────────────────────────────────────────────── #> #> - flat_full.Rmd #> - flat_title #> + flat_full.Rmd for working package #> - path #> + dev/flat_full.Rmd #> - state #> + 🍏 active #> - R #> - R/my_median.R #> + 👀 my_median #> - R/my_other_median.R #> + 👀 my_other_median #> + 🙈 sub_median #> - tests #> + tests/testthat/test-my_median.R #> + tests/testthat/test-my_other_median.R #> - vignettes #> + vignettes/get-started.Rmd #> - keep #> - path #> + keep #> - state #> + 🍏 active #> - R #> - R/my_extra_fun.R #> + 🙈 extra_fun #> - tests #> - vignettes #> ✔ Setting active project to ''"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/inflate.html","id":null,"dir":"Reference","previous_headings":"","what":"Inflate Rmd to package — inflate","title":"Inflate Rmd to package — inflate","text":"Inflate Rmd package","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/inflate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Inflate Rmd to package — inflate","text":"","code":"inflate( pkg = \".\", flat_file, vignette_name = \"Get started\", open_vignette = TRUE, check = TRUE, document = TRUE, overwrite = \"ask\", clean = \"ask\", update_params = TRUE, ... )"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/inflate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Inflate Rmd to package — inflate","text":"pkg Path package flat_file Path Rmarkdown file inflate vignette_name Character. Title resulting vignette. Use NA want create vignette. open_vignette Logical. Whether open vignette file end process check Logical. Whether check package Rmd inflating document Logical. Whether document package using att_amend_desc overwrite Logical (TRUE, FALSE) character (\"ask\", \"yes\", \"). Whether overwrite vignette functions already exists. clean Logical (TRUE, FALSE) character (\"ask\", \"yes\", \") Whether delete files anymore created current flat file. Typically, deleted renamed function flat file. Default \"ask\". update_params Logical. Whether update inflate parameters configuration file. ... Arguments passed devtools::check(). example, can inflate(check = TRUE, quiet = TRUE), quiet passed devtools::check().","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/inflate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Inflate Rmd to package — inflate","text":"Package structure. Return path current package.","code":""},{"path":[]},{"path":"https://thinkr-open.github.io/fusen/dev/reference/inflate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Inflate Rmd to package — inflate","text":"","code":"# Create a new project dummypackage <- tempfile(\"dummy.package\") dir.create(dummypackage) # {fusen} steps dev_file <- add_flat_template(template = \"full\", pkg = dummypackage, overwrite = TRUE) #> Created file .here in /tmp/RtmporxLlS/dummy.package187f5ece748b . 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\")) inflate( pkg = dummypackage, flat_file = flat_file, vignette_name = \"Exploration of my Data\", check = FALSE ) #> ✔ Setting active project to '/tmp/RtmporxLlS/dummy.package187f5ece748b' #> ℹ Loading dummy.package187f5ece748b #> Writing NAMESPACE #> ✔ Adding 'knitr' to Suggests field in DESCRIPTION #> • Use `requireNamespace(\"knitr\", quietly = TRUE)` to test if package is installed #> • Then directly refer to functions with `knitr::fun()` #> ✔ Adding 'inst/doc' to '.gitignore' #> ── config file for dev/flat_full.Rmd ─────────────────────────────────────────── #> ✔ R: R/my_median.R was added to the config file #> ✔ R: R/my_other_median.R was added to the config file #> ✔ tests: tests/testthat/test-my_median.R was added to the config file #> ✔ tests: tests/testthat/test-my_other_median.R was added to the config file #> ✔ vignettes: vignettes/exploration-of-my-data.Rmd was added to the config file #> Saving attachment parameters to yaml config file #> Updating dummy.package187f5ece748b documentation #> ℹ Loading dummy.package187f5ece748b #> Writing NAMESPACE #> Writing my_median.Rd #> Writing my_other_median.Rd #> Writing sub_median.Rd #> ℹ Loading dummy.package187f5ece748b #> [+] 3 package(s) added: stats, rmarkdown, testthat. # Explore directory of the package # browseURL(dummypackage) # Try pkgdown build # usethis::use_pkgdown() # pkgdown::build_site(dummypackage) # Delete dummy package unlink(dummypackage, recursive = TRUE)"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/inflate_all.html","id":null,"dir":"Reference","previous_headings":"","what":"Inflate all your flat files — inflate_all","title":"Inflate all your flat files — inflate_all","text":"Inflate flat files stored \"dev/\" starting \"flat_\"","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/inflate_all.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Inflate all your flat files — inflate_all","text":"","code":"inflate_all( pkg = \".\", document = TRUE, check = TRUE, open_vignette = FALSE, overwrite = TRUE, check_unregistered = TRUE, stylers, ... ) inflate_all_no_check( pkg = \".\", document = TRUE, open_vignette = FALSE, overwrite = TRUE, check_unregistered = TRUE, stylers, ... )"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/inflate_all.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Inflate all your flat files — inflate_all","text":"pkg Path package document Logical. Whether document package using att_amend_desc check Logical. Whether check package Rmd inflating open_vignette Logical. Whether open vignette file end process overwrite Logical (TRUE, FALSE) character (\"ask\", \"yes\", \"). Whether overwrite vignette functions already exists. check_unregistered Logical. Whether help detect unregistered files. Typically files created flat file added manually repository. stylers Function run end process, like styler::style_pkg lintr::lint_package lambda function combining functions like: function() {styler::style_pkg(); lintr::lint_package()}. unique function, use format without parenthesis () end command. ... Arguments passed devtools::check(). example, can inflate(check = TRUE, quiet = TRUE), quiet passed devtools::check().","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/inflate_all.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Inflate all your flat files — inflate_all","text":"side effect. Inflates flat files can inflated.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/inflate_all.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Inflate all your flat files — inflate_all","text":"requires inflate() flat files individually least , specific inflate configurations stored. also requires register R, tests vignettes files package, even created inflate. Run inflate_all() read messages. first time, probably need run register_all_to_config() package new. information, read vignette(\"inflate---flat-files\", package = \"fusen\")","code":""},{"path":[]},{"path":"https://thinkr-open.github.io/fusen/dev/reference/inflate_all.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Inflate all your flat files — inflate_all","text":"","code":"if (FALSE) { # Usually, in the current package run inflate_all() directly # These functions change the current user workspace inflate_all() # Or inflate_all_no_check() to prevent checks to run inflate_all_no_check() # Or inflate with the styler you want inflate_all(stylers = styler::style_pkg) } # You can also inflate_all flats of another package as follows # Example with a dummy package with a flat file dummypackage <- tempfile(\"inflateall.otherpkg\") dir.create(dummypackage) fill_description(pkg = dummypackage, fields = list(Title = \"Dummy Package\")) flat_files <- add_minimal_package( pkg = dummypackage, overwrite = TRUE, open = FALSE ) #> Created file .here in /tmp/RtmporxLlS/inflateall.otherpkg187f49f32550 . Please start a new R session in the new project directory. flat_file <- flat_files[grep(\"flat\", basename(flat_files))] # Inflate the flat file once usethis::with_project(dummypackage, { # if you are starting from a brand new package, inflate_all() will crash # it's because of the absence of a fusen config file # # inflate_all() # will crash # Add licence usethis::use_mit_license(\"John Doe\") # you need to inflate manually your flat file first inflate( pkg = dummypackage, flat_file = flat_file, vignette_name = \"Get started\", check = FALSE, open_vignette = FALSE, document = TRUE, overwrite = \"yes\" ) # your config file has been created config_yml_ref <- yaml::read_yaml(getOption(\"fusen.config_file\", default = \"dev/config_fusen.yaml\")) }) #> ✔ Setting active project to '/tmp/RtmporxLlS/inflateall.otherpkg187f49f32550' #> ✔ Adding 'MIT + file LICENSE' to License #> ✔ Writing 'LICENSE' #> ✔ Writing 'LICENSE.md' #> ✔ Adding '^LICENSE\\\\.md$' to '.Rbuildignore' #> ℹ Loading inflateall.otherpkg187f49f32550 #> Writing NAMESPACE #> ✔ Adding 'knitr' to Suggests field in DESCRIPTION #> • Use `requireNamespace(\"knitr\", quietly = TRUE)` to test if package is installed #> • Then directly refer to functions with `knitr::fun()` #> ✔ Adding 'inst/doc' to '.gitignore' #> ── config file for dev/flat_minimal.Rmd ──────────────────────────────────────── #> ✔ R: R/my_fun.R was added to the config file #> ✔ tests: tests/testthat/test-my_fun.R was added to the config file #> ✔ vignettes: vignettes/get-started.Rmd was added to the config file #> Saving attachment parameters to yaml config file #> Updating inflateall.otherpkg187f49f32550 documentation #> ℹ Loading inflateall.otherpkg187f49f32550 #> Writing NAMESPACE #> Writing my_fun.Rd #> ℹ Loading inflateall.otherpkg187f49f32550 #> [+] 2 package(s) added: rmarkdown, testthat. #> ✔ Setting active project to '/tmp/RtmporxLlS/dummy.package187f5ece748b' # Next time, you can run inflate_all() directly usethis::with_project(dummypackage, { # now you can run inflate_all() inflate_all(check = FALSE, document = TRUE) }) #> ✔ Setting active project to '/tmp/RtmporxLlS/inflateall.otherpkg187f49f32550' #> ✔ The flat file flat_minimal.Rmd is going to be inflated #> ── config file for dev/flat_minimal.Rmd ──────────────────────────────────────── #> ── check not registered files ────────────────────────────────────────────────── #> ✔ There are no unregistered files. #> Documentation parameters were restored from attachment config file. #> Updating inflateall.otherpkg187f49f32550 documentation #> ℹ Loading inflateall.otherpkg187f49f32550 #> Writing NAMESPACE #> ℹ Loading inflateall.otherpkg187f49f32550 #> ✔ Setting active project to '/tmp/RtmporxLlS/dummy.package187f5ece748b' # Clean the temporary directory unlink(dummypackage, recursive = TRUE)"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/init_share_on_github.html","id":null,"dir":"Reference","previous_headings":"","what":"Initiate GitHub to share your package on a website — init_share_on_github","title":"Initiate GitHub to share your package on a website — init_share_on_github","text":"uses 'pkgdown' share documentation package GitHub Actions. may need run usethis::create_github_token(), gitcreds::gitcreds_set() .","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/init_share_on_github.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Initiate GitHub to share your package on a website — init_share_on_github","text":"","code":"init_share_on_github(ask = TRUE, organisation = NULL)"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/init_share_on_github.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Initiate GitHub to share your package on a website — init_share_on_github","text":"ask Logical. TRUE (default) ask user apply instructions time needed, FALSE user already know . organisation supplied, repo created organisation, instead login associated GitHub token discovered host. user's role token's scopes must permission create repositories organisation.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/init_share_on_github.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Initiate GitHub to share your package on a website — init_share_on_github","text":"URL website created","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/init_share_on_github.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Initiate GitHub to share your package on a website — init_share_on_github","text":"init_share_on_github() runs multiple steps able share proper package GitHub: Start versionning git already Connect GitHub account Create minimal DESCRIPTION file missing update content information deployment Add NEWS file present modifications releases Add README.Rmd knit README.md quickly present aim use package Init continuous integration (CI) Check package Linux, Windows MacOS Calculate code coverage. Note may need connect https://.codecov.io/ see results code coverage. Init continuous deployment (CD) 'pkgdown' website documentation Commit push GitHub List remaining manual steps make website public Read vignette(\"share---github-website\", package = \"fusen\")","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/init_share_on_github.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Initiate GitHub to share your package on a website — init_share_on_github","text":"","code":"if (FALSE) { # This modifies the current directory and send it on GitHub init_share_on_github() }"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/load_flat_functions.html","id":null,"dir":"Reference","previous_headings":"","what":"Load the code of all 'function' chunk in a flat file — load_flat_functions","title":"Load the code of all 'function' chunk in a flat file — load_flat_functions","text":"Load code 'function' chunk flat file","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/load_flat_functions.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Load the code of all 'function' chunk in a flat file — load_flat_functions","text":"","code":"load_flat_functions(flat_file, envir = globalenv())"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/load_flat_functions.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Load the code of all 'function' chunk in a flat file — load_flat_functions","text":"flat_file Path flat load functions envir environment expr evaluated. May also NULL, list, data frame, pairlist integer specified sys.call.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/load_flat_functions.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Load the code of all 'function' chunk in a flat file — load_flat_functions","text":"Path flat file loaded. Used side effect: Load functions global environment.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/load_flat_functions.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Load the code of all 'function' chunk in a flat file — load_flat_functions","text":"","code":"if (FALSE) { # Use this command directly in the console fusen::load_flat_functions() # Or choose a flat file to load functions from load_flat_functions(flat_file = \"dev/flat_full.Rmd\") load_flat_functions(flat_file = \"dev/flat_clean_fusen_files.Rmd\") }"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/pipe.html","id":null,"dir":"Reference","previous_headings":"","what":"Pipe operator — %>%","title":"Pipe operator — %>%","text":"See magrittr::%>% details.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/pipe.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pipe operator — %>%","text":"","code":"lhs %>% rhs"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/pipe.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pipe operator — %>%","text":"lhs value magrittr placeholder. rhs function call using magrittr semantics.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/pipe.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pipe operator — %>%","text":"result calling rhs(lhs).","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/register_all_to_config.html","id":null,"dir":"Reference","previous_headings":"","what":"Include all existing package files in the config file — register_all_to_config","title":"Include all existing package files in the config file — register_all_to_config","text":"Helps transition non-fusen packages made earlier version","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/register_all_to_config.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Include all existing package files in the config file — register_all_to_config","text":"","code":"register_all_to_config(pkg = \".\", config_file)"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/register_all_to_config.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Include all existing package files in the config file — register_all_to_config","text":"pkg Path package add file configuration file config_file Path configuration file","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/register_all_to_config.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Include all existing package files in the config file — register_all_to_config","text":"Invisible path 'fusen' configuration file","code":""},{"path":[]},{"path":"https://thinkr-open.github.io/fusen/dev/reference/register_all_to_config.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Include all existing package files in the config file — register_all_to_config","text":"","code":"if (FALSE) { # Usually run this one inside the current project # Note: running this will write \"dev/config_fusen.yaml\" in your working directory register_all_to_config() } # Or you can try on the reproducible example dummypackage <- tempfile(\"register\") dir.create(dummypackage) # {fusen} steps fill_description(pkg = dummypackage, fields = list(Title = \"Dummy Package\")) dev_file <- suppressMessages(add_flat_template(pkg = dummypackage, overwrite = TRUE, open = FALSE)) flat_file <- dev_file[grepl(\"flat_\", dev_file)] # Inflate once usethis::with_project(dummypackage, { suppressMessages( inflate( pkg = dummypackage, flat_file = flat_file, vignette_name = \"Get started\", check = FALSE, open_vignette = FALSE ) ) out_path <- register_all_to_config(dummypackage) # Look at the output yaml::read_yaml(out_path) }) #> ✔ Setting active project to '/tmp/RtmporxLlS/register187f31ddf514' #> ── config file for dev/flat_full.Rmd ─────────────────────────────────────────── #> ✔ There are no unregistered files. #> There is no file to register or everything was already registered #> ✔ Setting active project to '/tmp/RtmporxLlS/dummy.package187f5ece748b' #> $flat_full.Rmd #> $flat_full.Rmd$path #> [1] \"dev/flat_full.Rmd\" #> #> $flat_full.Rmd$state #> [1] \"active\" #> #> $flat_full.Rmd$R #> [1] \"R/my_median.R\" \"R/my_other_median.R\" #> #> $flat_full.Rmd$tests #> [1] \"tests/testthat/test-my_median.R\" #> [2] \"tests/testthat/test-my_other_median.R\" #> #> $flat_full.Rmd$vignettes #> [1] \"vignettes/get-started.Rmd\" #> #> $flat_full.Rmd$inflate #> $flat_full.Rmd$inflate$flat_file #> [1] \"dev/flat_full.Rmd\" #> #> $flat_full.Rmd$inflate$vignette_name #> [1] \"Get started\" #> #> $flat_full.Rmd$inflate$open_vignette #> [1] FALSE #> #> $flat_full.Rmd$inflate$check #> [1] FALSE #> #> $flat_full.Rmd$inflate$document #> [1] TRUE #> #> $flat_full.Rmd$inflate$overwrite #> [1] \"ask\" #> #> $flat_full.Rmd$inflate$clean #> [1] \"ask\" #> #> #>"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/rename_flat_file.html","id":null,"dir":"Reference","previous_headings":"","what":"Rename a flat file — rename_flat_file","title":"Rename a flat file — rename_flat_file","text":"Rename flat file","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/rename_flat_file.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rename a flat file — rename_flat_file","text":"","code":"rename_flat_file(flat_file, new_name)"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/rename_flat_file.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rename a flat file — rename_flat_file","text":"flat_file Path flat file rename new_name New name flat file","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/rename_flat_file.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Rename a flat file — rename_flat_file","text":"Used side effect. Flat file renamed, config file updated, inflated files modified needed.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/rename_flat_file.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Rename a flat file — rename_flat_file","text":"","code":"if (FALSE) { # These functions change the current user workspace dev_file <- suppressMessages( add_flat_template( template = \"add\", pkg = \".\", overwrite = TRUE, open = FALSE ) ) rename_flat_file( flat_file = \"dev/flat_additional.Rmd\", new_name = \"flat_new.Rmd\" ) }"},{"path":[]},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"breaking-changes-0-6-0","dir":"Changelog","previous_headings":"","what":"Breaking changes","title":"fusen 0.6.0","text":"{fusen} now relies {lightparser} instead {parsermd} parse flat file. allows avoid installation problems {parsermd}, updated anymore. {lightparser} lighter, may unattended effects specific flat file cases. Please report issue may encounter. (#233) inflate_all*() use parameter clean anymore. Use check_unregistered instead check files registered configuration file.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"new-features-0-6-0","dir":"Changelog","previous_headings":"","what":"New features","title":"fusen 0.6.0","text":"draw_package_structure() along get_package_structure() allows draw package structure functions created R file, whether exported (#189) rename_flat_file() allows rename flat file, deals config inflated files deprecate_flat_file() helps properly deprecate flat file, modifies config file cleans previously inflated files inflate() detects functions renamed removed allow clean package repository (#24) Allow organisation init_share_on_github() send GitHub organisation Fix load_flat_functions() work VSCode","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"fusen-052","dir":"Changelog","previous_headings":"","what":"fusen 0.5.2","title":"fusen 0.5.2","text":"CRAN release: 2023-08-17","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"new-features-0-5-2","dir":"Changelog","previous_headings":"","what":"New features","title":"fusen 0.5.2","text":"Allow styler function parameter stylers inflate_all*() (e.g inflate_all(stylers = styler::style_pkg))","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"minor-changes-0-5-2","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"fusen 0.5.2","text":"Fix use packageVersion() character Allow “.” current package adding flat file without DESCRIPTION (#224)","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"fusen-051","dir":"Changelog","previous_headings":"","what":"fusen 0.5.1","title":"fusen 0.5.1","text":"CRAN release: 2023-06-29","code":""},{"path":[]},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"inflate-all-active-flat-file-0-5-1","dir":"Changelog","previous_headings":"New features","what":"Inflate all active flat file","title":"fusen 0.5.1","text":"inflate_all() uses configuration file inflate flat files . document check options thus run flat files. (#204, @ymansiaux) requires run inflate() least flat file. also requires register files, present package version ‘fusen’ register_all_to_config()","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"list-all-files-created-with-an-inflate-in-a-config-file-with-parameters-0-5-1","dir":"Changelog","previous_headings":"New features","what":"List all files created with an inflate() in a config file with parameters","title":"fusen 0.5.1","text":"inflate() creates configuration file “dev/config_fusen.yaml” register files created inflating corresponding flat file, along inflate parameters (#198, @ymansiaux)","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"breaking-changes-0-5-1","dir":"Changelog","previous_headings":"","what":"Breaking changes","title":"fusen 0.5.1","text":"Arguments rmd name function inflate() now lead errors (Deprecated since v0.3.0). add_dev_history() deprecated since v0.3.0 favor add_flat_template(). Now add_dev_history() adds “dev_history.Rmd” file “dev/” directory. add_flat_template(template = \"minimal\") longer exists avoid confusion minimal package minimal flat file. Indeed, now add_flat_template(template = \"minimal_package\") (also add_minimal_package()) add_flat_template(template = \"minimal_flat\") (also add_minimal_flat()). latter exactly add_additional() (#187) create_fusen() still uses minimal minimal_package","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"bug-fixes-0-5-1","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"fusen 0.5.1","text":"Fix using line break function name flat files (#142, @FlorenceMounier) project directory renamed “.package (Copy)”, inflate() still works, even name proper package name. important DESCRIPTION Package name correct.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"major-changes-0-5-1","dir":"Changelog","previous_headings":"","what":"Major changes","title":"fusen 0.5.1","text":"create_fusen() RStudio gui interface now accept flat_file parameter name first flat file well first function (using ‘minimal’ template). tips tricks vignette shortly presents combine {fusen} {golem} (#187) Incorrect function names issued addins add_flat_template() cleaned included flat file follow underscore rule.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"minor-changes-0-5-1","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"fusen 0.5.1","text":"Update CONTRIBUTING speak flat file {fusen} replace maintainer’s name fill_description() examples, templates tests (#155, @FlorenceMounier) create_fusen() vaccinates created git project (#171) Examples function roxygen documentation cleaned extra spaces empty #' avoid git diff code linters / stylers.","code":""},{"path":[]},{"path":[]},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"publish-your-package-website-on-github-0-5-0","dir":"Changelog","previous_headings":"New features","what":"Publish your package website on GitHub","title":"fusen 0.5.0","text":"Publish {fusen} project GitHub website one command: init_share_on_github()","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"list-all-files-created-with-an-inflate-in-a-config-file-0-5-0","dir":"Changelog","previous_headings":"New features","what":"List all files created with an inflate() in a config file","title":"fusen 0.5.0","text":"inflate() creates “dev/config_fusen.yaml” file register files created inflating corresponding flat file (First steps #24) Migrate non-fusen package previous version ‘fusen’ register_all_to_config() Create update config file data.frame df_to_config() list legitimate scripts (even associated flat file)","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"others-0-5-0","dir":"Changelog","previous_headings":"New features","what":"Others","title":"fusen 0.5.0","text":"Allow multiple examples function (#149)","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"bug-fixes-0-5-0","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"fusen 0.5.0","text":"Fix using word “function(” documentation (#174, @FlorenceMounier)","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"fusen-042","dir":"Changelog","previous_headings":"","what":"fusen 0.4.2","title":"fusen 0.4.2","text":"CRAN release: 2023-06-07","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"bug-0-4-2","dir":"Changelog","previous_headings":"","what":"Bug","title":"fusen 0.4.2","text":"Replacement unexported usethis functions (#205, @ateucher)","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"fusen-041","dir":"Changelog","previous_headings":"","what":"fusen 0.4.1","title":"fusen 0.4.1","text":"CRAN release: 2022-09-29","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"new-features-0-4-1","dir":"Changelog","previous_headings":"","what":"New features","title":"fusen 0.4.1","text":"Load function chunks flat file currently opened load_flat_functions() (Like load_all() flat file) Allow inflate() Quarto “.qmd” flat file (#160)","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"minor-0-4-1","dir":"Changelog","previous_headings":"","what":"Minor","title":"fusen 0.4.1","text":"Fix HTML5 doc","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"fusen-040","dir":"Changelog","previous_headings":"","what":"fusen 0.4.0","title":"fusen 0.4.0","text":"CRAN release: 2022-04-30","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"new-features-0-4-0","dir":"Changelog","previous_headings":"","what":"New features","title":"fusen 0.4.0","text":"inflate() current opened flat file flat_file empty (#138) Add rmarkdown template additional flat file RStudio Add wrappers around add_flat_template() lazy devs: add_additional(), add_full(), add_minimal() Show “flat_template” origin files generated {fusen} (@ ALanguillaume) Allow inflate(vignette_name = c(\"Super title\" = \"01-Super Slug\")) nice Title different vignette Entry (#87) Get author date flat file vignette (#129)","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"bug-fixes-0-4-0","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"fusen 0.4.0","text":"Read DESCRIPTION file package name available (#144 @VincentGuyader) Read nyc_squirrels encoding avoid encoding problems use_data() Allow flat files tests Extract yaml metadata flat file, like author date include inflated vignette Simplify “flat_teaching” unique simple function Fix asciify_name() account diacritics (@ ALanguillaume) Improve template ‘full’ internal data use Fix tests git exists","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"fusen-030","dir":"Changelog","previous_headings":"","what":"fusen 0.3.0","title":"fusen 0.3.0","text":"CRAN release: 2021-12-16","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"breaking-changes-0-3-0","dir":"Changelog","previous_headings":"","what":"Breaking changes","title":"fusen 0.3.0","text":"add_flat_template() superseeds add_dev_history() advanced possibilities add_dev_history() deprecated Vignette name create now set inflate(vignette_name = \"Get started\") instead name Flat name inflate now set inflate(flat_file = \"dev/flat_full.Rmd\") instead rmd","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"major-changes-0-3-0","dir":"Changelog","previous_headings":"","what":"Major changes","title":"fusen 0.3.0","text":"Check included now uses devtools::check() instead rcmdcheck() Avoid creating vignette inflate(vignette_name = NA) Decide whether open vignette inflate inflate(open_vignette = FALSE) Improve documentation included flat templates reflect changes using dev_history file Add RStudio Addin insert new flat template Add RStudio Addin insert chunks new function (@ColinFay) Deal \\dontrun{} example chunks Allow short names chunks: dev, fun, ex, test create_fusen() create {fusen} project command line RStudio new project (@ALanguillaume) Add “edit hand” files generated","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"grouping-functions-under-the-same-file-0-3-0","dir":"Changelog","previous_headings":"Major changes","what":"Grouping functions under the same file","title":"fusen 0.3.0","text":"Group functions R file test file (level 1 + level 2) titles Rmd Group functions R file test file @rdname roxygen tag Group functions R file test file @filename roxygen tag (recognized ‘fusen’) Group functions R file test file function chunk get chunk option {r function-my_func, filename = \"my_filename\"}","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"minor-changes-0-3-0","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"fusen 0.3.0","text":"add_flat_template() uses flat_name pre-fill template first function name. Fix .onLoad functions file creation Allow R6Class() function chunks Fix inflate function chunks data package documentation Fix inflate empty functions chunks Fix filename inflate templates new calls add_dev_history() (@Cervangirard) Default vignette name now “Get started” creating “vignettes/get-started.Rmd” open files saved using inflate() {RStudioapi} works Ask restart RStudio first inflate","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"fusen-024","dir":"Changelog","previous_headings":"","what":"fusen 0.2.4","title":"fusen 0.2.4","text":"CRAN release: 2021-08-04 Update vignette tests","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"fusen-023","dir":"Changelog","previous_headings":"","what":"fusen 0.2.3","title":"fusen 0.2.3","text":"CRAN release: 2021-07-26 Update unit tests Show check outputs console Ask overwriting everything Check Description Title description fields Check folder name correct package name","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"fusen-022","dir":"Changelog","previous_headings":"","what":"fusen 0.2.2","title":"fusen 0.2.2","text":"CRAN release: 2021-07-09 Protect tests older Pandoc versions","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"fusen-021","dir":"Changelog","previous_headings":"","what":"fusen 0.2.1","title":"fusen 0.2.1","text":"CRAN release: 2021-07-08 Fix documentation issues CRAN Add templates “dev_history.Rmd” file Add informative messages users New vignette explain maintain {fusen} package","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"fusen-020","dir":"Changelog","previous_headings":"","what":"fusen 0.2.0","title":"fusen 0.2.0","text":"Prepare CRAN","code":""},{"path":[]},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"features-0-1-1","dir":"Changelog","previous_headings":"","what":"features","title":"fusen 0.1.1","text":"Allow non-clean vignette name Allow different “dev_history” templates: “full”, “minimal” “additional”","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"documentation-0-1-1","dir":"Changelog","previous_headings":"","what":"documentation","title":"fusen 0.1.1","text":"Add vignette explain maintain package {fusen} Add vignette explain deal data Added NEWS.md file track changes package.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"tests-0-1-1","dir":"Changelog","previous_headings":"","what":"tests","title":"fusen 0.1.1","text":"Add tests corner cases Rmd templates","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"fusen-010","dir":"Changelog","previous_headings":"","what":"fusen 0.1.0","title":"fusen 0.1.0","text":"First release","code":""}] +[{"path":[]},{"path":"https://thinkr-open.github.io/fusen/dev/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement [INSERT CONTACT METHOD]. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.0, available https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. Community Impact Guidelines inspired Mozilla’s code conduct enforcement ladder. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https:// www.contributor-covenant.org/translations.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing to fusen","title":"Contributing to fusen","text":"outlines propose change fusen.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CONTRIBUTING.html","id":"all-contribution-welcomed","dir":"","previous_headings":"","what":"All contribution welcomed","title":"Contributing to fusen","text":"open contribution, typos new features. guide throughout process make safe position contribute, whatever level R programming.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CONTRIBUTING.html","id":"use-of-fusen-to-build-the-code-base-and-documentation","dir":"","previous_headings":"","what":"Use of ‘fusen’ to build the code base and documentation","title":"Contributing to fusen","text":"Package ‘fusen’ used build code base documentation ‘fusen’. ‘fusen’ package provides framework building R packages Rmarkdown file (Quarto file). See documentation ‘fusen’ details: https://thinkr-open.github.io/fusen","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CONTRIBUTING.html","id":"what-if-i-do-not-understand-how-to-use-fusen-","dir":"","previous_headings":"","what":"What if I do not understand how to use ‘fusen’ ?","title":"Contributing to fusen","text":"help. know modify package without ‘fusen’, contribute normally. Forget flat files moment. ‘fusen’ package still classical package remove “dev/” directory. difference. Open Pull Request help integrate contribution ‘fusen’ framework.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CONTRIBUTING.html","id":"some-tips-to-contribute-with-fusen","dir":"","previous_headings":"","what":"Some tips to contribute with ‘fusen’","title":"Contributing to fusen","text":"modifications can realized modifying ‘flat’ file “dev/” directory. , run fusen::inflate_all() generate corresponding R, test vignette files. can see list active flat files corresponding generated files opening “dev/config_fusen.yaml” file. one section flat file. see text like \"# WARNING - Generated 'fusen' dev/flat_***.Rmd: edit hand\" top generated R, test vignette files, actually generated ‘fusen’. file, generated ‘fusen’, listed \"keep\" section “dev/config_fusen.yaml” file. can run fusen::check_not_registered_files() check ’s case.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CONTRIBUTING.html","id":"modify-documentation","dir":"","previous_headings":"Some tips to contribute with ‘fusen’","what":"Modify documentation","title":"Contributing to fusen","text":"find roxygen skeleton corresponding function chunk Text vignette generally text chunk flat file","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CONTRIBUTING.html","id":"modify-of-a-function","dir":"","previous_headings":"Some tips to contribute with ‘fusen’","what":"Modify of a function","title":"Contributing to fusen","text":"recommend test driven development approach: Write modify unit test corresponding test chunk function Modify code function corresponding function chunk Run ‘inflate’ command bottom flat file Run devtools::test() check test passing avoid multiple inflates, can run code locally Instead inflating, run fusen::load_flat_functions() load function current flat file global environment Run tests line line test chunk can also use favorite debuging tools","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CONTRIBUTING.html","id":"fixing-typos","dir":"","previous_headings":"","what":"Fixing typos","title":"Contributing to fusen","text":"can fix typos, spelling mistakes, grammatical errors documentation directly using GitHub web interface, long changes made source file. generally means ’ll need edit roxygen2 comments .R, .Rd file. can find .R file generates .Rd reading comment first line.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CONTRIBUTING.html","id":"bigger-changes","dir":"","previous_headings":"","what":"Bigger changes","title":"Contributing to fusen","text":"want make bigger change, ’s good idea first file issue make sure someone team agrees ’s needed. ’ve found bug, please file issue illustrates bug minimal reprex (also help write unit test, needed).","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CONTRIBUTING.html","id":"pull-request-process","dir":"","previous_headings":"Bigger changes","what":"Pull request process","title":"Contributing to fusen","text":"Fork package clone onto computer. haven’t done , recommend using usethis::create_from_github(\"ThinkR-open/fusen\", fork = TRUE). Install development dependences devtools::install_dev_deps(), make sure package passes R CMD check running devtools::check(). R CMD check doesn’t pass cleanly, ’s good idea ask help continuing. Create Git branch pull request (PR). recommend using usethis::pr_init(\"brief-description--change\"). Make changes Open dev/dev_history.R file: rstudioapi::navigateToFile(\"dev/dev_history.R\") Find “# Dependencies —-” part run attachment::att_amend_desc(...) presented . update documentation list dependencies DESCRIPTION ones needed {fusen}. Commit git, create PR running usethis::pr_push(), following prompts browser. title PR briefly describe change. body PR contain Fixes #issue-number. user-facing changes, add bullet top NEWS.md (.e. just first header). Follow style described https://style.tidyverse.org/news.html.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CONTRIBUTING.html","id":"code-style","dir":"","previous_headings":"Bigger changes","what":"Code style","title":"Contributing to fusen","text":"New code follow tidyverse style guide. can use styler package apply styles, please don’t restyle code nothing PR. use roxygen2, Markdown syntax, documentation. use testthat unit tests. Contributions test cases included easier accept.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contributing to fusen","text":"Please note fusen project released Contributor Code Conduct. contributing project agree abide terms.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2019 ThinkR Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/How-to-use-fusen.html","id":"all-steps-to-create-a-package-with-fusen-from-one-rmd-file","dir":"Articles","previous_headings":"","what":"All steps to create a package with {fusen} from one Rmd file","title":"How to use fusen","text":"RStudio template: File > New Project > New directory > Package using {fusen} Choose template teaching start command line: create_fusen(\"path//new/project\", template = \"teaching\") Open “dev/flat_teaching” Rmd start setting package Run content first development chunk library(testthat) inside first time, can let code , already content working package Chunk named function gets code function Chunk named example gets code examples using function. used function @examples kept vignette Chunk named tests gets code unit testing Chunk named development gets code development purposes, usually used like {usethis} functions Run dev-inflate chunk inflate flat template transform inflated package functions, unit tests current Rmd template transformed vignette. check. Build {pkgdown} site verify everything right place Create multiple \"flat_xxx.Rmd\" files fusen::add_flat_template(template = \"add\") needed","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/How-to-use-fusen.html","id":"fill-your-package-description","dir":"Articles","previous_headings":"All steps to create a package with {fusen} from one Rmd file","what":"Fill your package Description","title":"How to use fusen","text":"Function fill_description() requires description package: ? developers? fill DESCRIPTION file proper way.","code":"fill_description( pkg = dummypackage, fields = list( Title = \"Build A Package From Rmarkdown file\", Description = paste( \"Use Rmarkdown First method to build your package.\", \"Start your package with documentation.\", \"Everything can be set from a Rmarkdown file in your project.\" ), `Authors@R` = c( person(\"John\", \"Doe\", email = \"john@email.me\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0000-0000-0000\")), person(given = \"Company\", role = \"cph\") ) ) )"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/How-to-use-fusen.html","id":"inflate-your-package-from-the-flat-rmd-template","dir":"Articles","previous_headings":"All steps to create a package with {fusen} from one Rmd file","what":"Inflate your package from the flat Rmd template","title":"How to use fusen","text":"’re one inflate flat paper box. Build package flat Rmd template using inflate() command . , can: Verify \"DESCRIPTION\" file updated Verify function \"R/\" directory Verify test \"tests/testthat/\" directory Verify Rmd appears \"vignettes/\" directory Build documentation using usethis::use_pkgdown() pkgdown::build() vignette examples checks","code":"fusen::inflate( flat_file = \"dev/flat_teaching.Rmd\", vignette_name = \"Exploration of my Data\", open_vignette = TRUE, document = TRUE, check = TRUE )"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/How-to-use-fusen.html","id":"create-a-new-package-from-command-line-directly-using-a-pre-defined-template","dir":"Articles","previous_headings":"","what":"Create a new package from command line directly, using a pre-defined template","title":"How to use fusen","text":"testing purposes","code":"# Create a new project dummypackage <- tempfile(pattern = \"dummy\") # {fusen} steps dev_file <- create_fusen(dummypackage, template = \"teaching\", open = FALSE) # Description fusen::fill_description(pkg = dummypackage, fields = list(Title = \"Dummy Package\")) # From inside the package usethis::with_project(dummypackage, { # Define License with use_*_license() usethis::use_mit_license(\"John Doe\") # You may need to execute inflate() in the console directly fusen::inflate( pkg = dummypackage, flat_file = dev_file, vignette_name = \"Get started\" ) }) # Explore directory of the package browseURL(dummypackage) # Delete dummy package unlink(dummypackage, recursive = TRUE)"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/How-to-use-fusen.html","id":"add-a-new-flat_template-rmd-template-in-dev-directory","dir":"Articles","previous_headings":"","what":"Add a new “flat_template.Rmd” template in “dev/” directory","title":"How to use fusen","text":"","code":"# Add an additional dev template add_flat_template(template = \"add\", pkg = dummypackage) # or directly add_additional(pkg = dummypackage)"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/How-to-use-fusen.html","id":"there-can-be-development-actions","dir":"Articles","previous_headings":"","what":"There can be development actions","title":"How to use fusen","text":"included flat template file, content part package anywhere else. Name following chunk {r development-something, eval=FALSE}","code":"```{r development-inflate, eval=FALSE} # Run but keep eval=FALSE to avoid infinite loop usethis::use_mit_license(\"John Doe\") # Execute in the console directly fusen::inflate(flat_file = \"dev/dev_history.Rmd\") ```"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/How-to-use-fusen.html","id":"limitations","dir":"Articles","previous_headings":"","what":"Limitations","title":"How to use fusen","text":"One title / one chunk one function examples tests chunks need placed associated function chunk can add sub-functions function chunk store R file, won’t @examples. first function chunk able get examples. Rmarkdown file, chunk names need unique. Thus, better use examples-myfunction, examples-myotherfunction, … forget regularly clear Workspace avoid functions hidden global environment","code":""},{"path":[]},{"path":"https://thinkr-open.github.io/fusen/dev/articles/Maintain-packages-with-fusen.html","id":"add-a-new-set-of-chunks-in-the-current-rmd","dir":"Articles","previous_headings":"Daily use of {fusen}","what":"Add a new set of chunks in the current Rmd","title":"Maintain packages with {fusen}","text":"Use Addin “Add {fusen} chunks” Name chunks using function name planned created Decide function exported user ","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/Maintain-packages-with-fusen.html","id":"create-a-new-flat-rmd-template","dir":"Articles","previous_headings":"Daily use of {fusen}","what":"Create a new flat Rmd template","title":"Maintain packages with {fusen}","text":"add new family functions, create new flat Rmd template","code":"add_flat_template(template = \"add\") # or directly add_additional()"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/Maintain-packages-with-fusen.html","id":"how-to-maintain-a-fusen-can-i-use-fusen-with-old-way-packages","dir":"Articles","previous_headings":"","what":"How to maintain a {fusen}? Can I use {fusen} with old-way packages ?","title":"Maintain packages with {fusen}","text":"inflate() “flat_template.Rmd”, code appears twice package. “flat_template.Rmd” correct place package. Take documentation developers. Maintaining package requires choice: Option 1: Modifications added “flat_template.Rmd” file, inflated update packages files Option 2: Modifications realized package files directly package, “flat_template.Rmd” file must deprecated using deprecate_flat_file(). first inflate() may directly work expected R code write. case, can continue implement functionality using Option 1. Advice 1: Use Option 1 find complicated used ! assure , find moment say : ok possible anymore… Advice 2: Use git soon possible, avoid losing work made modifications wrong place Advice 3: Create Readme.Rmd “dev/” directory chunk fusen::draw_package_structure() knit . help understand structure package see inflated . look {fusen} package GitHub see looks like.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/Maintain-packages-with-fusen.html","id":"option-1-continue-with-the-flat_template-rmd","dir":"Articles","previous_headings":"How to maintain a {fusen}? Can I use {fusen} with old-way packages ?","what":"Option 1: Continue with the “flat_template.Rmd”","title":"Maintain packages with {fusen}","text":"(+) encouraged start documenting testing package start coding, generally good practice prototyping. (+) require fully understand package structure files continue building package, continue develop unique file (-) need pay attention checking debugging tools may direct R file directly. requires pay attention always sure modifying code flat template file, inflated. (-) may trouble co-developers already built packages => {fusen} built . modification added dedicated dev_history file inflated => tree structure “dev/Readme.md” file useful understand inflated , see structure package","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/Maintain-packages-with-fusen.html","id":"option-2-maintain-like-a-classical-package","dir":"Articles","previous_headings":"How to maintain a {fusen}? Can I use {fusen} with old-way packages ?","what":"Option 2: Maintain like a classical package","title":"Maintain packages with {fusen}","text":"(+) can use dedicated checking debugging tools , particular RStudio. built direct quickly possible source problem (+) allows collaboration advanced developers used debug package structure directly (-) need remember need care users maintainers, need document test code soon possible, different place code . (-) requires understand structure files package interact , able jump one file , correct folder. may drives lazy continue documenting testing modifications can use deprecate_flat_file() protect original flat template file, never use . Inflated files also unprotected, can modify directly. => way add new functionalities packages started old way, specific cases inflating now complicated, like function inflate() unit tests {fusen} package.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/Maintain-packages-with-fusen.html","id":"what-about-packages-already-built-the-old-way","dir":"Articles","previous_headings":"","what":"What about packages already built the old way ?","title":"Maintain packages with {fusen}","text":"“flat_template.Rmd” template modifies files related functions presented inside template. remove modify previous functions, tests vignettes, provided names different. {fusen} started classical way enough functions able build package . prevent use {fusen} build now ! want modify existing functionalities, need continue maintain already-built package classical way want add new functionalities, correctly documented tested, can use {fusen}. delete previous work. Use “Option 2” continue development functionality","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/Maintain-packages-with-fusen.html","id":"lets-try-to-convince-package-developers-with-an-example","dir":"Articles","previous_headings":"What about packages already built the old way ?","what":"Let’s try to convince package developers with an example","title":"Maintain packages with {fusen}","text":"Install {fusen} : install.packages(\"fusen\") Commit previous state afraid {fusen} confident enough try existing package, create new package following guide “use fusen” Rmd file appears “dev/flat_additional.Rmd”. Open . Write new function function chunk. instance: ’re looking equivalent load_all() functions inside flat file inflating, can use fusen::load_flat_functions() Add corresponding unit test test chunk. instance: run {attachment} behind scene may modify list dependencies DESCRIPTION file accordingly. Use fusen::inflate(flat_file = \"dev/flat_additional.Rmd\", document = FALSE) avoid . also run devtools::check(). Use fusen::inflate(flat_file = \"dev/flat_additional.Rmd\", check = FALSE) avoid . create new vignette package. may want avoid fusen::inflate(flat_file = \"dev/flat_additional.Rmd\", vignette_name = NA) ’s ! added new function package, along example, test new vignette: R/my_median.R tests/testthat/test-my_median.R vignettes/get-started.Rmd","code":"#' My median #' #' @param x Vector of Numeric values #' @inheritParams stats::median #' #' @return #' Median of vector x #' @export #' #' @examples my_median <- function(x, na.rm = TRUE) { if (!is.numeric(x)) { stop(\"x should be numeric\") } stats::median(x, na.rm = na.rm) } my_median(1:12) test_that(\"my_median works properly and show error if needed\", { expect_true(my_median(1:12) == 6.5) expect_error(my_median(\"text\")) })"},{"path":[]},{"path":"https://thinkr-open.github.io/fusen/dev/articles/deal-with-a-fusen-flat-file.html","id":"rename-a-flat-file","dir":"Articles","previous_headings":"","what":"Rename a flat file","title":"Deal with a 'fusen' flat file","text":"‘fusen’ provides function rename_flat_file() rename flat file. function updates file name configuration file, modifies inflating files needed renames flat file . function avoid remaining inflated files repository, ensure configuration file --date.","code":"#' \\dontrun{ # These functions change the current user workspace dev_file <- suppressMessages( add_flat_template( template = \"add\", pkg = \".\", overwrite = TRUE, open = FALSE ) ) rename_flat_file( flat_file = \"dev/flat_additional.Rmd\", new_name = \"flat_new.Rmd\" ) #' }"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/deal-with-a-fusen-flat-file.html","id":"fully-deprecate-a-flat-file-after-inflate","dir":"Articles","previous_headings":"","what":"Fully deprecate a flat file after inflate","title":"Deal with a 'fusen' flat file","text":"‘fusen’ serves framework ensure developers prioritize end-users function development process. employing ‘fusen’ within Rmd/Qmd files, developers can conceptualize product articulate ideas plain text initiating code. approach encourages consideration package’s users: intended actions, potential impact experiences. Consequently, developers can draft function documentation prior implementation, thinking explaining ’s behind black box, well reminding may end vignette. Additionally, ‘fusen’ offers minimal template comprising ‘function’, ‘doc’, ‘test’ components. advocate Test Driven Development (TDD), writing tests precedes function implementation. practice aids function design enables anticipation future behavior. Subsequently, can proceed implement function , thereafter inflating flat file generate R, test, vignette files. initial iteration yields comprehensive documentation, complete test suite, functional implementation. Following initial phase, option : Continue iterating function, documentation, tests within flat file, updating R, test, vignette files accordingly inflation. Opt iterate directly within “R/”, “tests/”, “vignette/” directories. preference transition away flat file conduct development specified directories, proper deprecation flat file recommended. facilitate transition, function deprecate_flat_file() provided. function cleans script files removing “edit” markers, updates ‘fusen’ configuration file, relocates flat file “dev/flat_history/” directory, preserving cleanliness “dev/” directory.","code":"#' \\dontrun{ #' # These functions change the current user workspace dev_file <- suppressMessages( add_flat_template( template = \"add\", pkg = dummypackage, overwrite = TRUE, open = FALSE ) ) deprecate_flat_file(flat_file = \"dev/flat_additional.Rmd\") #' }"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/draw-a-tree-of-your-package-files-and-functions.html","id":"get-a-tree-of-the-package-structure-to-help-developers","dir":"Articles","previous_headings":"","what":"Get a tree of the package structure to help developers","title":"Draw a tree of your package files and functions","text":"get_package_structure() function helps developers understand package structure. reads dev/config_fusen.yaml file, adds list resulting functions extra description files. can know: description flat file issued Title exists flat file still active list R files issued flat file list functions inside R files list files tests issued flat file possibility list functions called test files vignette issued flat file draw_package_structure(), can draw tree package structure console. also works R package, fusen built packages.","code":"#' \\dontrun{ #' # This only works inside a 'fusen' built package #' pkg_structure <- get_package_structure() #' draw_package_structure(pkg_structure) #' } #' #' # Example with a dummy package dummypackage <- tempfile(\"drawpkg.structure\") dir.create(dummypackage) # {fusen} steps fill_description(pkg = dummypackage, fields = list(Title = \"Dummy Package\")) dev_file <- suppressMessages( add_flat_template(pkg = dummypackage, overwrite = TRUE, open = FALSE) ) flat_file <- dev_file[grepl(\"flat_\", dev_file)] usethis::with_project(dummypackage, { # Add an extra R file with internal function # to list in \"keep\" dir.create(\"R\") cat(\"extra_fun <- function() {1}\\n\", file = \"R/my_extra_fun.R\") # Works with classical package pkg_structure <- get_package_structure() draw_package_structure(pkg_structure) }) #> ✔ Setting active project to #> '/tmp/Rtmpxo27O0/drawpkg.structure19bc5037f76f' #> ── No NAMESPACE file found there: /tmp/Rtmpxo27O0/drawpkg.structure19bc5037f76f #> ── keep ──────────────────────────────────────────────────────────────────────── #> #> - keep #> - path #> + keep #> - state #> + 🍏 active #> - R #> - R/my_extra_fun.R #> + 🙈 extra_fun #> - tests #> - vignettes #> ✔ Setting active project to '' usethis::with_project(dummypackage, { # Works with 'fusen' package suppressMessages( inflate( pkg = dummypackage, flat_file = flat_file, vignette_name = \"Get started\", check = FALSE, open_vignette = FALSE ) ) pkg_structure <- get_package_structure() draw_package_structure(pkg_structure) }) #> ✔ Setting active project to #> '/tmp/Rtmpxo27O0/drawpkg.structure19bc5037f76f' #> ── config file for dev/flat_full.Rmd ─────────────────────────────────────────── #> ── Reading NAMESPACE file ────────────────────────────────────────────────────── #> ── flat_full.Rmd ─────────────────────────────────────────────────────────────── #> ── keep ──────────────────────────────────────────────────────────────────────── #> #> - flat_full.Rmd #> - flat_title #> + flat_full.Rmd for working package #> - path #> + dev/flat_full.Rmd #> - state #> + 🍏 active #> - R #> - R/my_median.R #> + 👀 my_median #> - R/my_other_median.R #> + 👀 my_other_median #> + 🙈 sub_median #> - tests #> + tests/testthat/test-my_median.R #> + tests/testthat/test-my_other_median.R #> - vignettes #> + vignettes/get-started.Rmd #> - keep #> - path #> + keep #> - state #> + 🍏 active #> - R #> - R/my_extra_fun.R #> + 🙈 extra_fun #> - tests #> - vignettes #> ✔ Setting active project to ''"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/draw-a-tree-of-your-package-files-and-functions.html","id":"get-the-list-of-functions-from-a-r-file","dir":"Articles","previous_headings":"","what":"Get the list of functions from a R file","title":"Draw a tree of your package files and functions","text":"","code":"file_path <- tempfile(fileext = \".R\") cat( \"my_fun <- function() {1}\", \"my_fun2 <- function() {2}\", sep = \"\\n\", file = file_path ) get_all_created_funs(file_path) #> [1] \"my_fun\" \"my_fun2\""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/inflate-all-your-flat-files.html","id":"inflate-all-your-flat-files-at-once","dir":"Articles","previous_headings":"","what":"Inflate all your flat files at once","title":"Inflate all your flat files","text":"inflate_all() function allows user inflate active flat files available “dev/” directory . requires inflate new flat file individually least order register inflate parameters. Prior able inflate flat files, checks performed, assess whether flat files available used inflate_all().","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/inflate-all-your-flat-files.html","id":"store-configuration-of-each-flat-file-once","dir":"Articles","previous_headings":"Inflate all your flat files at once","what":"Store configuration of each flat file once","title":"Inflate all your flat files","text":"inflate_all() requires existence complete {fusen} configuration file: “dev/config_fusen.yaml”. file exists versions {fusen} upper v0.5.0: working project initiated version {fusen} prior v0.5.0, please manually run inflate() flat files want work , order create appropriate “dev/config_fusen.yaml” file. already familiar “dev/config_fusen.yaml” working dev version {fusen} prior v0.5.1, “dev/config_fusen.yaml” file contain inflate-related parameters. inflate flat files order complete configuration file proper inflate() parameters.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/inflate-all-your-flat-files.html","id":"prevent-some-flat-files-to-be-inflated","dir":"Articles","previous_headings":"Inflate all your flat files at once","what":"Prevent some flat files to be inflated","title":"Inflate all your flat files","text":"flat file listed configuration file, inflated time run inflate_all(). want flat file inflated anymore, can deprecate . Open configuration file “dev/config_fusen.yaml”. Find section concerning flat file. Change state: active state: deprecated. inflated following calls inflate_all(). may flat file work progress inflated yet. affect flat files inflated. case may see following message. can ignore .","code":"The flat file {flat} is not going to be inflated. It was detected in your flats directory but it is absent from the config file. Please inflate() it manually when you are ready, so that it is accounted the next time."},{"path":"https://thinkr-open.github.io/fusen/dev/articles/inflate-all-your-flat-files.html","id":"wrapper-around-inflate_all","dir":"Articles","previous_headings":"Inflate all your flat files at once","what":"Wrapper around inflate_all()","title":"Inflate all your flat files","text":"wrapper named inflate_all_no_check() prevent running devtools::check(). short version inflate_all(check = FALSE).","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/inflate-all-your-flat-files.html","id":"register-all-other-files-to-help-clean-your-project","dir":"Articles","previous_headings":"Inflate all your flat files at once","what":"Register all other files to help clean your project","title":"Inflate all your flat files","text":"Note also files stored R, tests vignettes directories checked detect created flat file. need registered config file , order help keep package clean deprecated files. inflate_all() thus runs check_not_registered_files() behind scene informs procedure. Read vignette('register-files--config', package = 'fusen') get information.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/inflate-all-your-flat-files.html","id":"complete-the-process-with-your-own-code-style","dir":"Articles","previous_headings":"Inflate all your flat files at once","what":"Complete the process with your own code style","title":"Inflate all your flat files","text":"can run preferred styling functions just check package inflate_all(). instance, want {styler} package clean code inflate process, can run inflate_all(stylers = styler::style_pkg). also like clean “dev/” directory, can run inflate_all(stylers = function() {styler::style_pkg(); styler::style_dir(\"dev\")}).","code":"#' \\dontrun{ # Usually, in the current package run inflate_all() directly # These functions change the current user workspace inflate_all() # Or inflate_all_no_check() to prevent checks to run inflate_all_no_check() # Or inflate with the styler you want inflate_all(stylers = styler::style_pkg) #' } # You can also inflate_all flats of another package as follows # Example with a dummy package with a flat file dummypackage <- tempfile(\"inflateall.otherpkg\") dir.create(dummypackage) fill_description(pkg = dummypackage, fields = list(Title = \"Dummy Package\")) flat_files <- add_minimal_package( pkg = dummypackage, overwrite = TRUE, open = FALSE ) flat_file <- flat_files[grep(\"flat\", basename(flat_files))] # Inflate the flat file once usethis::with_project(dummypackage, { # if you are starting from a brand new package, inflate_all() will crash # it's because of the absence of a fusen config file # # inflate_all() # will crash # Add licence usethis::use_mit_license(\"John Doe\") # you need to inflate manually your flat file first inflate( pkg = dummypackage, flat_file = flat_file, vignette_name = \"Get started\", check = FALSE, open_vignette = FALSE, document = TRUE, overwrite = \"yes\" ) # your config file has been created config_yml_ref <- yaml::read_yaml(getOption(\"fusen.config_file\", default = \"dev/config_fusen.yaml\")) }) # Next time, you can run inflate_all() directly usethis::with_project(dummypackage, { # now you can run inflate_all() inflate_all(check = FALSE, document = TRUE) }) # Clean the temporary directory unlink(dummypackage, recursive = TRUE)"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/register-files-in-config.html","id":"fusen-registers-all-files-of-your-package","dir":"Articles","previous_headings":"","what":"{fusen} registers all files of your package","title":"Register files in config","text":"{fusen} >=0.5, file named “dev/config_fusen.yaml” (default) registers files created specific “flat” file soon inflate . helps keep track link flat files R, tests vignettes files created package. configuration file also register files created flat file. helps keep package clean. know special steps realize version {fusen}, run: Messages function guide transition used old version {fusen}. Chances need : Inflate flat file project one one (least ) version {fusen} Run fusen::check_not_registered_files() Check content “dev/config_not_registered.csv” unregistered files. Clean package useless unregistered files required. Register remaining unregistered files fusen::register_all_to_config() Try fusen::inflate_all_no_check() fusen::inflate_all() good now.Read vignette(\"inflate---flat-files\", package = \"fusen\") know inflate_all().","code":"fusen::inflate_all_no_check()"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/register-files-in-config.html","id":"what-is-the-configuration-file","dir":"Articles","previous_headings":"","what":"What is the configuration file?","title":"Register files in config","text":"configuration file stored “dev/config_fusen.yaml”. lists flat files inflated, along lists files created inflate parameters used inflate. also list files, created flat files, section named “keep”. instance, part configuration file package {fusen} looks like:","code":"flat_addins.Rmd: path: dev/flat_addins.Rmd state: active R: R/build_fusen_chunks.R tests: tests/testthat/test-build_fusen_chunks.R vignettes: [] inflate: flat_file: dev/flat_addins.Rmd vignette_name: .na open_vignette: true check: false document: true overwrite: ask keep: path: keep R: - R/addins.R - R/create_fusen_rsproject.R - R/fusen-package.R - R/globals.R - R/inflate-utils.R - R/load_flat_functions.R - R/utils-pipe.R tests: - tests/testthat/test-create_fusen_rsproject.R - tests/testthat/test-inflate_qmd.R - tests/testthat/test-inflate_utils.R - tests/testthat/test-load_flat_functions.R - tests/testthat/test-skeleton.R vignettes: vignettes/tips-and-tricks.Rmd"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/register-files-in-config.html","id":"what-about-unregistered-files","dir":"Articles","previous_headings":"","what":"What about unregistered files?","title":"Register files in config","text":"Imagine inflated function named my_fun(), decide change name function my_new_fun(). inflate, two files “R/myfun.R” “R/my_new_fun.R” package. However, “R/myfun.R” deleted function exist anymore. unsure files still , can run fusen::check_not_registered_files(). case, “R/myfun.R” appear csv file created “dev/config_not_registered.csv”, message like “Possibly deprecated file”. now possibility detect deprecated files project. Run fusen::check_not_registered_files() often need want clean project. Note function included fusen::inflate_all() fusen::inflate_all_no_check(), let opportunity clean project regularly. able detect deprecated files, legitimate files need registered. Even ones created manually. case, listed \"keep\" section. {fusen} knows bother files.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/register-files-in-config.html","id":"deprecate-flat-files-after-inflate","dir":"Articles","previous_headings":"","what":"Deprecate flat files after inflate","title":"Register files in config","text":"example configuration file , can note “flat_addins.Rmd” section parameter state: active means inflate_all() indeed inflate file. practice {fusen} inflate , continue development R, test vignette files directly, may want properly deprecated flat file. case, recommend store flat file sub-directory named “dev/dev_history/” default behavior future release. , can change flat file state: deprecated configuration file, change path: section file .","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/register-files-in-config.html","id":"detect-all-files-that-are-not-registered-in-configuration-file","dir":"Articles","previous_headings":"","what":"Detect all files that are not registered in configuration file","title":"Register files in config","text":"check_not_registered_files() shows files already registered yaml config file.Note check_not_registered_files() try guess source flat template, used {fusen} >= 0.4 . csv file “dev/config_not_registered.csv” created check_not_registered_files() lists unregistered files. contains three columns: type: type file among R, test vignette path: path find unregistered file flat file detected already appears configuration file, unregistered file probably deprecated file needs deleted. know. flat file detected already configuration file, section flat file created next step register_all_to_config(). source detected, probably means created manually. Decide files want delete. run fusen::register_all_to_config() register remaining files “keep” section. look configuration file end process check everything set properly. Maybe flat files detected state: active state: deprecated. ’re one knows.","code":"#' \\dontrun{ # Run this on the current package in development out_csv <- check_not_registered_files() file.edit(out_csv) #' } # Or you can try on the reproducible example dummypackage <- tempfile(\"clean\") dir.create(dummypackage) # {fusen} steps fill_description(pkg = dummypackage, fields = list(Title = \"Dummy Package\")) dev_file <- suppressMessages(add_flat_template(pkg = dummypackage, overwrite = TRUE, open = FALSE)) flat_file <- dev_file[grepl(\"flat_\", dev_file)] # Inflate once usethis::with_project(dummypackage, { suppressMessages( inflate( pkg = dummypackage, flat_file = flat_file, vignette_name = \"Get started\", check = FALSE, open_vignette = FALSE ) ) # Add a not registered file to the package cat(\"# test R file\\n\", file = file.path(dummypackage, \"R\", \"to_keep.R\")) # Use the function to check the list of files out_csv <- check_not_registered_files(dummypackage) out_csv # Read the csv to see what is going on content_csv <- read.csv(out_csv, stringsAsFactors = FALSE) content_csv # Keep it all or delete some files, and then register all remaining out_config <- register_all_to_config() out_config # Open the out_config file to see what's going on yaml::read_yaml(out_config) }) unlink(dummypackage, recursive = TRUE)"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/register-files-in-config.html","id":"how-register_all_to_config-works","dir":"Articles","previous_headings":"","what":"How register_all_to_config() works","title":"Register files in config","text":"files current state legitimate, , can register everything config file. Run register_all_to_config() current package create “dev/config_fusen.yaml” registers files. note “keep” section, lists files source guessed. function deletes “config_not_registered.csv” created check_not_registered_files().","code":"#' \\dontrun{ # Usually run this one inside the current project # Note: running this will write \"dev/config_fusen.yaml\" in your working directory register_all_to_config() #' } # Or you can try on the reproducible example dummypackage <- tempfile(\"register\") dir.create(dummypackage) # {fusen} steps fill_description(pkg = dummypackage, fields = list(Title = \"Dummy Package\")) dev_file <- suppressMessages(add_flat_template(pkg = dummypackage, overwrite = TRUE, open = FALSE)) flat_file <- dev_file[grepl(\"flat_\", dev_file)] # Inflate once usethis::with_project(dummypackage, { suppressMessages( inflate( pkg = dummypackage, flat_file = flat_file, vignette_name = \"Get started\", check = FALSE, open_vignette = FALSE ) ) out_path <- register_all_to_config(dummypackage) # Look at the output yaml::read_yaml(out_path) })"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/share-on-a-github-website.html","id":"initiate-your-package-and-share-it-on-github","dir":"Articles","previous_headings":"","what":"Initiate your package and share it on GitHub","title":"Share on a GitHub website","text":"Create new project {fusen} using git Follow “dev/0-dev_history.Rmd” describe project least, fill fusen::fill_description() function identity Write code supposed plain markdown Separate function example test chunks Create new sections flat template Addin > add {fusen} chunk Sections transferred correct places get proper package set checks run verify work properly documented tested may need run usethis::create_github_token(), gitcreds::gitcreds_set() , registered GitHub token yet. asked multiple times want commit, can say “yes” time. minutes, ’ll able see share project website. won’t run command line . time push new commits main branch GitHub, website updated thanks GitHub Actions.","code":"# Describe your project fusen::fill_description( pkg = here::here(), fields = list( Title = \"Share Your Project Following Good Development Practices From a Rmarkdown File\", Description = \"Use Rmarkdown First method. Strengthen your work with documentation and tests. Everything can be set from a Rmarkdown file in your project.\", `Authors@R` = c( person(\"John\", \"Doe\", email = \"john@email.me\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0000-0000-0000\")) ) ) ) # Define License with use_*_license() usethis::use_mit_license(\"John Doe\") fusen::inflate(flat_file = \"dev/flat_full.Rmd\", vignette_name = \"Get started\") #' \\dontrun{ #' # This modifies the current directory and send it on GitHub init_share_on_github() #' }"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/share-on-a-github-website.html","id":"what-happens-behind-the-scene","dir":"Articles","previous_headings":"","what":"What happens behind the scene ?","title":"Share on a GitHub website","text":"init_share_on_github() runs multiple steps able share proper package GitHub: Start versionning git already Connect GitHub account update content information deployment Add NEWS file present modifications releases Add README.Rmd knit README.md quickly present aim use package Check package Linux, Windows MacOS Calculate code coverage Init continuous deployment (CD) {pkgdown} website documentation Commit push GitHub List remaining manual steps make website public","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/switch-from-a-package-developed-with-fusen-to-a-classical-package.html","id":"move-from-a-package-developed-with-fusen-to-a-classical-package","dir":"Articles","previous_headings":"","what":"Move from a package developed with fusen to a “classical” package","title":"Switch from a package developed with fusen to a classical package","text":", may want move package developed fusen “classical” package. possible sepuku() function. function delete flat files (.e files listed fusen configuration file, well rmd qmd files starting “flat” “dev/” “dev/flat_history” folders). also remove fusen-related tags added calls fusen::inflate() files located “R/”, “tests/” “vignettes/” folders. Finally, also remove fusen configuration file exists. Switching package developed fusen “classical” package might useful want share package someone familiar fusen want stop using fusen reason. Please aware operation irreversible. lose history flat files fusen-related tags package. Therefore, recommended use code versioning able revert , case change mind.","code":"#' \\dontrun{ sepuku() # If you want to force the cleaning, you can use the force argument sepuku(force = TRUE) # Example with a dummy package dummypackage <- tempfile(\"sepuku.example\") dir.create(dummypackage) fill_description(pkg = dummypackage, fields = list(Title = \"Dummy Package\")) usethis::with_project(dummypackage, { # Add licence usethis::use_mit_license(\"John Doe\") dir.create(file.path(dummypackage, \"dev\")) dir.create(file.path(dummypackage, \"dev\", \"flat_history\")) # We add 2 flat files in the package and inflate them dev_file1 <- add_minimal_flat( pkg = dummypackage, flat_name = \"flat1.Rmd\", open = FALSE ) dev_file2 <- add_minimal_flat( pkg = dummypackage, flat_name = \"flat2.Rmd\", open = FALSE ) inflate( pkg = dummypackage, flat_file = dev_file1, vignette_name = \"Get started\", check = FALSE, open_vignette = FALSE, document = TRUE, overwrite = \"yes\" ) inflate( pkg = dummypackage, flat_file = dev_file2, vignette_name = \"Get started 2\", check = FALSE, open_vignette = FALSE, document = TRUE, overwrite = \"yes\" ) # We deprecate the first flat file, which will be moved to the flat_history folder deprecate_flat_file( file.path(dummypackage, \"dev\", \"flat_flat1.Rmd\") ) # We create 2 flat files with the qmd extension file.create(file.path(dummypackage, \"dev\", \"flat_history\", \"flat_old.qmd\")) file.create(file.path(dummypackage, \"dev\", \"flat_qmd.qmd\")) sepuku(force = TRUE) # We check that the fusen configuration file has been deleted file.exists( file.path(dummypackage, \"dev\", \"config_fusen.yaml\") ) # We check that all the flat files have been deleted length( list.files(file.path(dummypackage, \"dev\"), pattern = \"^flat.*\\\\.Rmd\" ) ) length( list.files(file.path(dummypackage, \"dev\"), pattern = \"^flat.*\\\\.qmd\" ) ) length( list.files(file.path(dummypackage, \"dev\", \"flat_history\"), pattern = \"^flat.*\\\\.Rmd\" ) ) length( list.files(file.path(dummypackage, \"dev\", \"flat_history\"), pattern = \"^flat.*\\\\.qmd\" ) ) # We check that all the files with fusen tags have been cleaned length(fusen:::find_files_with_fusen_tags(pkg = dummypackage)) }) # Clean the temporary directory unlink(dummypackage, recursive = TRUE) #' }"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"can-i-be-lazy-in-names-used","dir":"Articles","previous_headings":"","what":"Can I be lazy in names used?","title":"Tips and tricks","text":"function can named fun- fun_ fun-my_function_name example can named ex- ex_ ex-my_function_name tests can named test- test-my_function_name development can named dev- dev_ dev-my_function_name wrappers around add_flat_template() lazy developers: add_additional(), add_full(), add_minimal()","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"can-i-knit-the-content-of-the-flat-template","dir":"Articles","previous_headings":"","what":"Can I knit the content of the flat template ?","title":"Tips and tricks","text":"Yes. Although real goal, flat template can filled run like Rmarkdown file. However, need keep mind transformed R package, requires specific attention. Use development chunk beginning flat template declare packages need explore code Note used anywhere package. development chunk code exploration, development. Remember package structure, examples tests code run independently. Thus, examples tests chunk need code required run independently. development chunk contains inflate() call need eval=FALSE parameter avoid side effects knit flat file.","code":"```{r dev} library(glue) library(stringi) ```"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"how-to-declare-packages-with-library-for-the-future-vignette","dir":"Articles","previous_headings":"","what":"How to declare packages with library() for the future vignette ?","title":"Tips and tricks","text":"use classical chunk, without specific name, copied vignette.","code":"```{r} library(glue) library(stringi) ```"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"how-to-include-examples-that-cannot-be-run","dir":"Articles","previous_headings":"","what":"How to include examples that cannot be run ?","title":"Tips and tricks","text":"created chunk example want example run function example want run vignette. Use eval=FALSE chunk options, wont run vignette Use #' \\dontrun{} syntax, #' examples function example run","code":"```{r function-myfunction} myfunction <- function(x) { x } ``` ```{r example-myfunction, eval=FALSE} # Will be run in example but not in vignette myfunction(10) # Will not be run in example #' \\dontrun{ myfunction(12) #' } #' \\dontrun{ #' myfunction(12) #' } ```"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"document-your-internal-datasets-in-a-function-chunk-as-usual","dir":"Articles","previous_headings":"","what":"Document your internal datasets in a function chunk as usual","title":"Tips and tricks","text":"document datasets, pkgdoc, special R files, can write function chunk. {fusen} detect keyword function() R6Class() function chunk code, chunk copied “R/” file.","code":"```{r function-cars} #' cars #' #' data in 'datasets'. #' #' @format A data frame with 50 rows and 2 variables: #' \\describe{ #' \\item{ speed }{ numeric } #' \\item{ dist }{ numeric } #' } #' @source Ezekiel, M. (1930) Methods of Correlation Analysis. Wiley. \"cars\" ```"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"how-to-ignore-some-chunks","dir":"Articles","previous_headings":"","what":"How to ignore some chunks ?","title":"Tips and tricks","text":"chunks named dev development used package. Use exploration want keep end process. won’t affect package.","code":"```{r dev} # Some code exploration ```"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"how-to-create-a-vignette-with-different-title-and-index-entry","dir":"Articles","previous_headings":"","what":"How to create a vignette with different title and Index Entry?","title":"Tips and tricks","text":"can use inflate(vignette_name = c(\"Super title\" = \"01-Super Slug\")) vignette title different vignette Entry","code":"inflate(vignette_name = c(\"Super title\" = \"01-Super Vignette Index Entry\"))"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"how-not-to-create-a-vignette","dir":"Articles","previous_headings":"","what":"How not to create a vignette?","title":"Tips and tricks","text":"build internal functions, may want inflate flat file vignette. flat file developer’s documentation may enough","code":"inflate(vignette_name = NA)"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"how-to-get-a-pre-filled-template-for-a-specific-function-name","dir":"Articles","previous_headings":"","what":"How to get a pre-filled template for a specific function name ?","title":"Tips and tricks","text":"first function flat template: can create template add_flat_template(\"minimal\", flat_name = \"my_function_name\"). case, template pre-filled function name: chunk names, function calls. can also use RStudio Addin “Add {fusen} flat template” create new template “dev/” directory. prompt template type function name second function inside existing template: Position prompt want add new function use RStudio Addin: “Add {fusen} chunks”. asked function name. Addin uses add_fusen_chunks(\"my_function_name\")","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"how-to-pre-fill-multiple-functions-in-one-template","dir":"Articles","previous_headings":"How to get a pre-filled template for a specific function name ?","what":"How to pre-fill multiple functions in one template","title":"Tips and tricks","text":"can added “dev_history.Rmd”, replace place holder flat rmd (case) proper fusen chunks future functions . Add line flat file","code":"# Path of the flat file path_flat_rmd <- here::here(\"dev/flat_minimal.Rmd\") # Name of future functions to add - example fun_nms <- c( \"get_contract_by_country_of\", \"get_contract_subsidies_of\", \"get_contract_effort_of\", \"get_contract_fees_of\", \"get_contract_target_countries_of\", \"get_contract_all_info_of\" ) # Create content l_chunks <- purrr::map_chr(fun_nms, fusen:::build_fusen_chunks) chunks <- paste(l_chunks, collapse = \"\") # Add in the flat file flat_rmd <- readLines(path_flat_rmd) flat_rmd <- sub(\"^HERE$\", chunks, flat_rmd) writeLines(flat_rmd, path_flat_rmd)"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"how-to-inflate-multiple-flat-files","dir":"Articles","previous_headings":"","what":"How to inflate multiple flat files ?","title":"Tips and tricks","text":"Use inflate_all() Read dedicated vignette “inflate---flat-files”","code":"vignette(\"inflate-all-your-flat-files\", package = \"fusen\")"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"how-to-store-multiple-functions-in-a-unique-r-file","dir":"Articles","previous_headings":"","what":"How to store multiple functions in a unique R file ?","title":"Tips and tricks","text":"multiple ways . Choose one : use section title structure, use roxygen tags use chunk parameter.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"all-functions-under-one-title-section","dir":"Articles","previous_headings":"How to store multiple functions in a unique R file ?","what":"All functions under one title section","title":"Tips and tricks","text":"Use 3-set chunks (fun, example, test) twice, title section Rmd","code":"# One title for both groups of chunk The code and tests for the first function ```{r function-fun1} ``` ```{r example-fun1} ``` ```{r test-fun1} ``` The code and tests for the second function ```{r function-fun2} ``` ```{r example-fun2} ``` ```{r test-fun2} ```"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"use-same-rdname-in-function-roxygen","dir":"Articles","previous_headings":"How to store multiple functions in a unique R file ?","what":"Use same @rdname in function roxygen","title":"Tips and tricks","text":"","code":"# Title 1 for function 1 ```{r function-fun_rdname1} #' My fun_rdname1 #' #' @param x Vector of Numeric values #' @inheritParams stats::median #' #' @rdname same_rdname #' @return #' Median of vector x #' @export #' #' @examples #' my_fun_rdname1(2:20) my_fun_rdname1 <- function(x, na.rm = TRUE) { if (!is.numeric(x)) { stop(\"x should be numeric\") } stats::median(x, na.rm = na.rm) } ``` # Title 2 for function 2 ```{r function-fun_rdname2} #' My fun_rdname2 #' #' @param x Vector of Numeric values #' @inheritParams stats::median #' #' @rdname same_rdname #' @return #' Median of vector x #' @export #' #' @examples #' my_fun_rdname2(2:20) my_fun_rdname2 <- function(x, na.rm = TRUE) { if (!is.numeric(x)) { stop(\"x should be numeric\") } stats::median(x, na.rm = na.rm) } ```"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"use-same-filename-in-function-roxygen","dir":"Articles","previous_headings":"How to store multiple functions in a unique R file ?","what":"Use same @filename in function roxygen","title":"Tips and tricks","text":"@filename recognized {fusen} proper roxygen tag merge multiple functions “R/” “tests/” files. code line removed resulting “R/” files avoid interference Roxygenize.","code":"# Title 1 for function 1 ```{r function-fun_filename1} #' My fun_filename1 #' #' @param x Vector of Numeric values #' @inheritParams stats::median #' #' @filename same_filename #' @return #' Median of vector x #' @export #' #' @examples #' my_fun_filename1(2:20) my_fun_filename1 <- function(x, na.rm = TRUE) { if (!is.numeric(x)) { stop(\"x should be numeric\") } stats::median(x, na.rm = na.rm) } ``` # Title 2 for function 2 ```{r function-fun_filename2} #' My fun_filename2 #' #' @param x Vector of Numeric values #' @inheritParams stats::median #' #' @filename same_filename #' @return #' Median of vector x #' @export #' #' @examples #' my_fun_filename2(2:20) my_fun_filename2 <- function(x, na.rm = TRUE) { if (!is.numeric(x)) { stop(\"x should be numeric\") } stats::median(x, na.rm = na.rm) } ```"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"use-chunk-param-filename-the_comon_filename","dir":"Articles","previous_headings":"How to store multiple functions in a unique R file ?","what":"Use chunk param filename = \"the_comon_filename\"","title":"Tips and tricks","text":"Add function chunk ","code":"# Title 1 for function 1 ```{r function-fun_chunk1, filename = \"fun_chunk1\"} #' The code of your function 1 ``` ```{r example-fun_chunk1} ``` ```{r test-fun_chunk1} ``` # Title 2 for function 2 ```{r function-fun_chunk2, filename = \"fun_chunk1\"} #' The code of your function 2 ``` ```{r example-fun_chunk2} ``` ```{r test-fun_chunk2} ```"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"how-to-read-dataset-that-i-usually-put-in-teststestthat-for-my-unit-tests","dir":"Articles","previous_headings":"","what":"How to read dataset that I usually put in “tests/testthat/” for my unit tests?","title":"Tips and tricks","text":"checks, tests run relative “tests/testthat/” directory. need anticipate two ways reading data: One within flat file, needs modified One use future test file","code":"# The path relative to the \"tests/testthat\" directory for tests the_file <- \"my_file.csv\" if (!file.exists(the_file)) { # The path to use during dev in the flat file the_file <- file.path(\"tests\", \"testthat\", the_file) if (!file.exists(the_file)) { stop(the_file, \" does not exist\") } } my_file <- read.csv(the_file)"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"can-i-load-all-functions-of-the-current-flat-file-during-development-without-having-to-inflate","dir":"Articles","previous_headings":"","what":"Can I load all functions of the current flat file during development without having to inflate()?","title":"Tips and tricks","text":"Yes. can run load function chunks currently opened flat file load_flat_functions(). long flat file currently development, inflate(), sometimes difficult run chunks needed multiple modifications. can also useful start development day . load_flat_functions() like load_all() flat file, although account dependencies. console, run: can also run function chunks specific flat file :","code":"fusen::load_flat_functions() fusen::load_flat_functions(flat_file = \"dev/flat_full.Rmd\")"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"can-i-inflate-a-quarto-qmd-file","dir":"Articles","previous_headings":"","what":"Can I inflate a Quarto qmd file?","title":"Tips and tricks","text":"Yes can. long include qmd flat file good R package vignette, can use qmd format. really change output anything flat file meant rendered. vignette created flat file still Rmd file. !? Hence, can add flat file change extension “.qmd” like.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"can-i-use-fusen-with-golem","dir":"Articles","previous_headings":"","what":"Can I use {fusen} with {golem}?","title":"Tips and tricks","text":"course ! even recommended allows properly separate business logic (“dev/” directory) UI (modules “R/” directory). Start creating {golem} project. can start adding flat files. recommend create modules names relation flat files, can better navigate project. Although default {golem} “dev/” files already contain main actions maintain package, can still add “0-dev_history.Rmd” file recommended {fusen} using add_dev_history(). Note sections redundant {golem} dev files.","code":"golem::create_golem('my.golem.app') fusen::add_minimal_flat(flat_name = \"page1\") golem::add_module(name = \"page1\")"},{"path":"https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html","id":"how-can-i-know-if-r-files-were-created-from-a-flat-or-not","dir":"Articles","previous_headings":"","what":"How can I know if R files were created from a flat or not ?","title":"Tips and tricks","text":"can draw structure package `fusen:::draw_package_structure(). Read vignette “Draw tree package files functions”” details.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Sebastien Rochette. Author, maintainer. ThinkR. Copyright holder.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Rochette S (2024). fusen: Build Package Rmarkdown Files. R package version 0.6.0.9001, https://github.com/Thinkr-open/fusen, https://thinkr-open.github.io/fusen/.","code":"@Manual{, title = {fusen: Build a Package from Rmarkdown Files}, author = {Sebastien Rochette}, year = {2024}, note = {R package version 0.6.0.9001, https://github.com/Thinkr-open/fusen}, url = {https://thinkr-open.github.io/fusen/}, }"},{"path":"https://thinkr-open.github.io/fusen/dev/index.html","id":"fusen-","dir":"","previous_headings":"","what":"Build a Package from Rmarkdown Files","title":"Build a Package from Rmarkdown Files","text":"{fusen} inflates Rmarkdown file magically create package. know create Rmarkdown file, know build package. Fill flat Rmd (qmd) template everything one place {fusen} inflate identified parts correct package files directories. {fusen} Rmarkdown template encourages users fill documentation tests time writing functions code. Thanks R package structure used {fusen}, can build robust workflow R package. {fusen} simplifies reduces number steps towards full R package. , {pkgdown} documentation website one command away shared users. {fusen} package real-world example {fusen} use created flat templates available \"dev/\" folder GitHub repository. can look architecture Readme “dev” directory.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Build a Package from Rmarkdown Files","text":"can install released CRAN version: Full documentation CRAN version : https://thinkr-open.github.io/fusen/ can install development version {fusen} r-universe GitHub: Full documentation development version : https://thinkr-open.github.io/fusen/dev/","code":"install.packages(\"fusen\") # From r-universe.dev (No need for GITHUB_PAT) install.packages(\"fusen\", repos = c(\"https://thinkr-open.r-universe.dev\", \"https://cloud.r-project.org\")) # Or with {pak} using GitHub API - Need for GITHUB_PAT # install.packages(\"pak\") pak::pak(\"ThinkR-open/fusen\")"},{"path":"https://thinkr-open.github.io/fusen/dev/index.html","id":"you-are-one-rmd-away-from-building-a-package","dir":"","previous_headings":"","what":"You are one Rmd away from building a package!","title":"Build a Package from Rmarkdown Files","text":"{fusen} correctly separating naming chunks. RStudio template: File > New Project > New directory > Package using {fusen} Choose template teaching first time see {fusen} works, Choose template full second time answer questions command line: create_fusen(\"path//new/project\", template = \"teaching\") Open “dev/flat_teaching.Rmd” start setting package look like lines code: probably develop examples tests first time, can let code , already content working package open vignette created Share website GitHub ’s ! built package! documented tested package!even website ! Let’s test now: Install package locally can restart RStudio session let appear “Build” tab panel Test functions package","code":"fill_description(fields = list(Title = \"My Awesome Package\")) usethis::use_mit_license(\"John Doe\") fusen::inflate( flat_file = \"dev/flat_teaching.Rmd\", vignette_name = \"Get started\", check = TRUE ) fusen::init_share_on_github() remotes::install_local() my.package::my_median(1:12)"},{"path":"https://thinkr-open.github.io/fusen/dev/index.html","id":"description-of-the-rmd-template","dir":"","previous_headings":"","what":"Description of the Rmd template","title":"Build a Package from Rmarkdown Files","text":"said earlier, using correct split name chunks. Chunk named function gets code function chunk names unique future vignette, can add function names like example-myfunction, example-myotherfunction, … Chunk named tests gets code unit testing Chunk named development gets code development purposes, usually used like {usethis} functions Inflate flat Rmd template transform package functions, unit tests current Rmd transformed vignette. check. Note \"flat*.Rmd\" files created templates full teaching indeed working examples can directly inflated. can also look {squirrels.fusen} built present method. Follow commits: https://github.com/statnmap/squirrels.fusen/commits/main","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/index.html","id":"how-to-maintain-a-fusen-can-i-use-fusen-with-old-way-packages","dir":"","previous_headings":"","what":"How to maintain a {fusen}? Can I use {fusen} with old-way packages?","title":"Build a Package from Rmarkdown Files","text":"dedicated vignette answer : https://thinkr-open.github.io/fusen/articles/Maintain-packages--fusen.html Option 1: first inflate flat file, can continue developing “flat_template.Rmd” file, inflate using fusen::inflate_all() Option 2: ’re done inflating, can decide deprecate flat file fusen::deprecate_flat_file() develop package files directly, R package. ‘fusen’ impact structure classical package inflated. Advice: Use git soon possible, avoid losing work made modifications wrong place Advice: Show package structure fusen::draw_package_structure() “dev/Readme.md” file help developers","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/index.html","id":"who-is-fusen-for","dir":"","previous_headings":"","what":"Who is {fusen} for?","title":"Build a Package from Rmarkdown Files","text":"mind documentation users tests maintainers, {fusen} . Start writing documentation tests conceive functionalities, directly available users maintainers. Indeed, write Rmarkdown file (vignette), create documentation analysis (package). write functions, check functions examples maybe write unit tests verify outputs. even true follow guide : ‘Rmd first’: development starts documentation Write file explore possibilities let {fusen} store right place ! {fusen} first addressed people never wrote package know write Rmarkdown file. Understanding package infrastructure correctly settling can frightening. package may help first step! {fusen} also addressed advanced developers care users sustainability products, fed switching R files, tests files, vignettes prototype functions. particular, changing arguments function, need change examples, unit tests multiple places. , can one place. risk forget one. Think also code review: everything related one function place.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/index.html","id":"qa--all-tips-and-tricks-of-a-fusen-template","dir":"","previous_headings":"","what":"Q&A : All tips and tricks of a {fusen} template","title":"Build a Package from Rmarkdown Files","text":"Can lazy names used? Can knit content flat template ? declare packages library() future vignette ? include examples run ? Document internal datasets function chunk usual ignore chunks ? create vignette different title Index Entry? create vignette ? get pre-filled template specific function name ? inflate multiple flat files ? store multiple functions unique R file ? read dataset usually put “tests/testthat/” unit tests? Can load functions current flat file development without inflate()? Can inflate Quarto qmd file? Can use {fusen} {golem}? can know R files created flat ? => See vignette Tips Tricks: https://thinkr-open.github.io/fusen/articles/tips--tricks.html","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/index.html","id":"why-is-this-package-named-fusen-","dir":"","previous_headings":"","what":"Why is this package named {fusen} ?","title":"Build a Package from Rmarkdown Files","text":"fusen origami. flat piece paper fold specific way end, can magically inflate let nice box appear. Similarly, {fusen} package uses flat Rmd template, fill specific way end, can magically inflate() let nice package appear.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/index.html","id":"contributing","dir":"","previous_headings":"","what":"Contributing","title":"Build a Package from Rmarkdown Files","text":"‘fusen’ partially built using ‘fusen’ . ’re sure contribute using ‘fusen’, can contribute package: package made help ‘fusen’ exactly structure classical package. Knowing , want contribute ‘fusen’, can follow instructions CONTRIBUTING.md file.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/index.html","id":"acknowledgments","dir":"","previous_headings":"","what":"Acknowledgments","title":"Build a Package from Rmarkdown Files","text":"Thanks Deemah asked go ‘Rmd first’ presentation useR 2019 Toulouse: ‘“Rmd first” method: projects start documentation’ (Video Youtube: https://youtu./cB1BCxFbhtk). Now replaced {lightparser} : https://github.com/ThinkR-open/lightparser Thanks ThinkR team adopted package daily production.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/index.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Build a Package from Rmarkdown Files","text":"Please note {fusen} project released Contributor Code Conduct. contributing project, agree abide terms.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/add_flat_template.html","id":null,"dir":"Reference","previous_headings":"","what":"Add flat Rmd file that drives package development — add_additional","title":"Add flat Rmd file that drives package development — add_additional","text":"Add flat Rmd file drives package development","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/add_flat_template.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add flat Rmd file that drives package development — add_additional","text":"","code":"add_additional( pkg = \".\", dev_dir = \"dev\", flat_name = \"additional\", overwrite = FALSE, open = TRUE ) add_minimal_flat( pkg = \".\", dev_dir = \"dev\", flat_name = \"minimal\", overwrite = FALSE, open = TRUE ) add_minimal_package( pkg = \".\", dev_dir = \"dev\", flat_name = \"minimal\", overwrite = FALSE, open = TRUE ) add_full( pkg = \".\", dev_dir = \"dev\", flat_name = \"full\", overwrite = FALSE, open = TRUE ) add_dev_history(pkg = \".\", dev_dir = \"dev\", overwrite = FALSE, open = TRUE) add_flat_template( template = c(\"full\", \"minimal_package\", \"minimal_flat\", \"additional\", \"teaching\", \"dev_history\"), pkg = \".\", dev_dir = \"dev\", flat_name = NULL, overwrite = FALSE, open = TRUE )"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/add_flat_template.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add flat Rmd file that drives package development — add_additional","text":"pkg Path save file dev_dir Name directory development Rmarkdown files. Default \"dev\". flat_name Name file write dev. Use name main function template get chunks pre-filled function name. overwrite Whether overwrite existing flat Rmd template file name open Logical. Whether open file creation template Name template use. See details.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/add_flat_template.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add flat Rmd file that drives package development — add_additional","text":"Create flat Rmd file(s) template(s) return () path","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/add_flat_template.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add flat Rmd file that drives package development — add_additional","text":"Choose template among different templates available: \"full\": full template reproducible package can directly inflated. comes along \"dev_history\" template. Default. \"minimal_package\": Minimal template start new package already know 'fusen', along \"dev_history\" template. Note called \"minimal\" create_fusen(). \"minimal_flat\" \"additional\": Template new minimal flat file . \"teaching\": Template reproducible package, simpler \"full\", everything teach minimal structure package. \"dev_history\": Template functions commonly used package development. contain chunks write functions. Abbreviated names can also used different templates: \"add\" additional, \"minflat\" minimal_flat, \"minpkg\" minimal_package \"teach\" teaching, \"dev\" \"dev_history\". add_additional(), add_minimal_flat(), add_dev_history(), add_minimal_package(), add_full() wrapper around add_flat_template(\"additional\"), ...","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/add_flat_template.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add flat Rmd file that drives package development — add_additional","text":"","code":"# Create a new project dummypackage <- tempfile(\"dummy.package.flat\") dir.create(dummypackage) # Add add_flat_template(template = \"teaching\", pkg = dummypackage) #> Created file .here in /tmp/RtmpERNo3g/dummy.package.flat17e87cc3dff8 . Please start a new R session in the new project directory. #> [1] \"/tmp/RtmpERNo3g/dummy.package.flat17e87cc3dff8/dev/flat_teaching.Rmd\" # Delete dummy package unlink(dummypackage, recursive = TRUE) # For classical use in your package if (FALSE) { # first time ever using 'fusen' add_flat_template(\"full\") # first time in your new package add_flat_template(\"minimal_package\") # add new flat file for new functions add_flat_template(\"add\") add_additional() add_minimal_flat() # add only the dev_history file in an existing package add_dev_history() # add new flat template for teaching (a reduced full template) add_flat_template(\"teaching\") }"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/add_fusen_chunks.html","id":null,"dir":"Reference","previous_headings":"","what":"Add 'fusen' chunks — add_fusen_chunks","title":"Add 'fusen' chunks — add_fusen_chunks","text":"Create 'fusen' chunks inside Rmd","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/add_fusen_chunks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add 'fusen' chunks — add_fusen_chunks","text":"","code":"add_fusen_chunks( function_name = NULL, export = getOption(\"fusen.export.functions\") )"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/add_fusen_chunks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add 'fusen' chunks — add_fusen_chunks","text":"function_name Name function create. NULL ( default), user prompted enter . export function exported? Default getOption(\"fusen.export.functions\"). NULL, user prompted enter .","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/add_fusen_chunks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add 'fusen' chunks — add_fusen_chunks","text":"list context content, invisibly.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/add_fusen_chunks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add 'fusen' chunks — add_fusen_chunks","text":"","code":"if (FALSE) { add_fusen_chunks(\"this\", export = TRUE) }"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/check_not_registered_files.html","id":null,"dir":"Reference","previous_headings":"","what":"Show in a table files that are not already registered in the yaml config file — check_not_registered_files","title":"Show in a table files that are not already registered in the yaml config file — check_not_registered_files","text":"user start package without 'fusen' version < 0.4, need create config file, already existing functions.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/check_not_registered_files.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Show in a table files that are not already registered in the yaml config file — check_not_registered_files","text":"","code":"check_not_registered_files( path = \".\", config_file, guess = TRUE, to_csv = TRUE, open = FALSE )"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/check_not_registered_files.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Show in a table files that are not already registered in the yaml config file — check_not_registered_files","text":"path Path package check registered files config_file Path configuration file guess Logical. Guess file inflated specific flat file to_csv Logical. Whether store along config file, outputs csv user clean manually open Logical. Whether open csv unregistered files.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/check_not_registered_files.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Show in a table files that are not already registered in the yaml config file — check_not_registered_files","text":"Path csv file to_csv TRUE. dput() dataframe otherwise.","code":""},{"path":[]},{"path":"https://thinkr-open.github.io/fusen/dev/reference/check_not_registered_files.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Show in a table files that are not already registered in the yaml config file — check_not_registered_files","text":"","code":"if (FALSE) { # Run this on the current package in development out_csv <- check_not_registered_files() file.edit(out_csv) } # Or you can try on the reproducible example dummypackage <- tempfile(\"clean\") dir.create(dummypackage) # {fusen} steps fill_description(pkg = dummypackage, fields = list(Title = \"Dummy Package\")) dev_file <- suppressMessages(add_flat_template(pkg = dummypackage, overwrite = TRUE, open = FALSE)) flat_file <- dev_file[grepl(\"flat_\", dev_file)] # Inflate once usethis::with_project(dummypackage, { suppressMessages( inflate( pkg = dummypackage, flat_file = flat_file, vignette_name = \"Get started\", check = FALSE, open_vignette = FALSE ) ) # Add a not registered file to the package cat(\"# test R file\\n\", file = file.path(dummypackage, \"R\", \"to_keep.R\")) # Use the function to check the list of files out_csv <- check_not_registered_files(dummypackage) out_csv # Read the csv to see what is going on content_csv <- read.csv(out_csv, stringsAsFactors = FALSE) content_csv # Keep it all or delete some files, and then register all remaining out_config <- register_all_to_config() out_config # Open the out_config file to see what's going on yaml::read_yaml(out_config) }) #> ✔ Setting active project to '/tmp/RtmpERNo3g/clean17e86e4de566' #> ── config file for dev/flat_full.Rmd ─────────────────────────────────────────── #> ℹ Some files in your package are not registered in the configuration file stored in dev/config_fusen.yaml: R/to_keep.R #> fusen uses a configuration file to store the structure of your package and help you clean it when needed. #> You will find a list of unregistered files there: csv_file that you can open with `file.edit('dev/config_not_registered.csv')` #> #> Delete unregistered files that you do not need anymore. Then run `fusen::register_all_to_config()`. #> After that, this message should not appear in your next `fusen::check_not_registered_files()` or `fusen::inflate_all()` calls. #> For more information, read `vignette('register-files-in-config (`vignette(fusen::register-files-in-config)`)', package = 'fusen')` #> cli-147-230 #> ✔ R: R/to_keep.R was added to the config file #> ── Delete dev/config_not_registered.csv ──────────────────────────────────────── #> ✔ Setting active project to '' #> $flat_full.Rmd #> $flat_full.Rmd$path #> [1] \"dev/flat_full.Rmd\" #> #> $flat_full.Rmd$state #> [1] \"active\" #> #> $flat_full.Rmd$R #> [1] \"R/my_median.R\" \"R/my_other_median.R\" #> #> $flat_full.Rmd$tests #> [1] \"tests/testthat/test-my_median.R\" #> [2] \"tests/testthat/test-my_other_median.R\" #> #> $flat_full.Rmd$vignettes #> [1] \"vignettes/get-started.Rmd\" #> #> $flat_full.Rmd$inflate #> $flat_full.Rmd$inflate$flat_file #> [1] \"dev/flat_full.Rmd\" #> #> $flat_full.Rmd$inflate$vignette_name #> [1] \"Get started\" #> #> $flat_full.Rmd$inflate$open_vignette #> [1] FALSE #> #> $flat_full.Rmd$inflate$check #> [1] FALSE #> #> $flat_full.Rmd$inflate$document #> [1] TRUE #> #> $flat_full.Rmd$inflate$overwrite #> [1] \"ask\" #> #> $flat_full.Rmd$inflate$clean #> [1] \"ask\" #> #> #> #> $keep #> $keep$path #> [1] \"keep\" #> #> $keep$state #> [1] \"active\" #> #> $keep$R #> [1] \"R/to_keep.R\" #> #> $keep$tests #> list() #> #> $keep$vignettes #> list() #> #> unlink(dummypackage, recursive = TRUE)"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/create_fusen.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a new fusen project — create_fusen","title":"Create a new fusen project — create_fusen","text":"Create new fusen project","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/create_fusen.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a new fusen project — create_fusen","text":"","code":"create_fusen( path, template = c(\"full\", \"minimal\", \"teaching\", \"dev_history\"), flat_name = template, open = TRUE, overwrite = FALSE, with_git = FALSE )"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/create_fusen.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a new fusen project — create_fusen","text":"path Character. Path create new fusen project. template Character. Name template used among \"full\", \"minimal\", \"teaching\" \"dev_history\". flat_name Character. Filename flat file created. also used name first function file minimal template. open Logical. newly created project opened ? overwrite Logical. Allow overwrite 'dev/' files path exists. with_git Logical. git initialized newly created project ?","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/create_fusen.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a new fusen project — create_fusen","text":"Path dev flat files. Side-effect: Create new directory build package","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/create_fusen.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a new fusen project — create_fusen","text":"See add_flat_template details different options template. Template \"additional\" available meant used already existing 'fusen'.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/create_fusen.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a new fusen project — create_fusen","text":"","code":"my_path <- tempfile(\"mypkg\") create_fusen(path = my_path, template = \"full\", open = FALSE) #> ── Creating new directory: /tmp/RtmpERNo3g/mypkg17e858058e6b ─────────────────── #> ✔ Creating '/tmp/RtmpERNo3g/mypkg17e858058e6b/' #> ✔ Setting active project to '/tmp/RtmpERNo3g/mypkg17e858058e6b' #> ✔ Creating 'R/' #> ✔ Writing a sentinel file '.here' #> • Build robust paths within your project via `here::here()` #> • Learn more at #> ✔ Setting active project to '' #> ✔ New directory created: /tmp/RtmpERNo3g/mypkg17e858058e6b #> ✔ Added /tmp/RtmpERNo3g/mypkg17e858058e6b/dev/flat_full.Rmd, /tmp/RtmpERNo3g/mypkg17e858058e6b/dev/0-dev_history.Rmd"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/deprecate_flat_file.html","id":null,"dir":"Reference","previous_headings":"","what":"Deprecate a flat file — deprecate_flat_file","title":"Deprecate a flat file — deprecate_flat_file","text":"inflated [inflate_all()] identified deprecated config file. Previously generated files get \"edit hand\" message removed. flat file moved \"dev/flat_history\".","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/deprecate_flat_file.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Deprecate a flat file — deprecate_flat_file","text":"","code":"deprecate_flat_file(flat_file)"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/deprecate_flat_file.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Deprecate a flat file — deprecate_flat_file","text":"flat_file Path flat file deprecate","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/deprecate_flat_file.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Deprecate a flat file — deprecate_flat_file","text":"Used side effect. Move flat file \"dev/flat_history\", update config file, remove \"edit hand\" message.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/deprecate_flat_file.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Deprecate a flat file — deprecate_flat_file","text":"","code":"if (FALSE) { # These functions change the current user workspace dev_file <- suppressMessages( add_flat_template( template = \"add\", pkg = dummypackage, overwrite = TRUE, open = FALSE ) ) deprecate_flat_file(flat_file = \"dev/flat_additional.Rmd\") }"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/fill_description.html","id":null,"dir":"Reference","previous_headings":"","what":"Fill DESCRIPTION file of the package — fill_description","title":"Fill DESCRIPTION file of the package — fill_description","text":"Fill DESCRIPTION file package","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/fill_description.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fill DESCRIPTION file of the package — fill_description","text":"","code":"fill_description(pkg = \".\", fields, overwrite = FALSE)"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/fill_description.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fill DESCRIPTION file of the package — fill_description","text":"pkg Path package fields named list fields add DESCRIPTION, potentially overriding default values. See use_description can set personalized defaults using package options overwrite Whether overwrite existing DESCRIPTION","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/fill_description.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fill DESCRIPTION file of the package — fill_description","text":"Fill DESCRIPTION file fields. Return path file.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/fill_description.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fill DESCRIPTION file of the package — fill_description","text":"","code":"# Create a new project dummypackage <- tempfile(\"dummy.package.desc\") dir.create(dummypackage) fill_description( pkg = dummypackage, fields = list( Title = \"Build A Package From Rmarkdown file\", Description = paste( \"Use Rmd First method to build your package.\", \"Start your package with documentation.\", \"Everything can be set from a Rmarkdown file in your project.\" ), `Authors@R` = c( person(\"John\", \"Doe\", email = \"john@email.me\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0000-0000-0000\") ) ) ) ) #> ! Title was modified to 'Title Case'. # Delete dummy package unlink(dummypackage, recursive = TRUE)"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/fusen-package.html","id":null,"dir":"Reference","previous_headings":"","what":"fusen: Build a Package from Rmarkdown Files — fusen-package","title":"fusen: Build a Package from Rmarkdown Files — fusen-package","text":"Use Rmarkdown First method build package. Start package documentation, functions, examples tests unique file. Everything can set Rmarkdown template file provided project, inflated package. Inflating template copies relevant chunks sections appropriate files required package development.","code":""},{"path":[]},{"path":"https://thinkr-open.github.io/fusen/dev/reference/fusen-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"fusen: Build a Package from Rmarkdown Files — fusen-package","text":"Maintainer: Sebastien Rochette sebastienrochettefr@gmail.com (ORCID) contributors: ThinkR [copyright holder]","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/get_all_created_funs.html","id":null,"dir":"Reference","previous_headings":"","what":"Get all functions created in a R file — get_all_created_funs","title":"Get all functions created in a R file — get_all_created_funs","text":"Get functions created R file","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/get_all_created_funs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get all functions created in a R file — get_all_created_funs","text":"","code":"get_all_created_funs(file)"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/get_all_created_funs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get all functions created in a R file — get_all_created_funs","text":"file R file","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/get_all_created_funs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get all functions created in a R file — get_all_created_funs","text":"character vector function names","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/get_all_created_funs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get all functions created in a R file — get_all_created_funs","text":"","code":"file_path <- tempfile(fileext = \".R\") cat( \"my_fun <- function() {1}\", \"my_fun2 <- function() {2}\", sep = \"\\n\", file = file_path ) get_all_created_funs(file_path) #> [1] \"my_fun\" \"my_fun2\""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/get_package_structure.html","id":null,"dir":"Reference","previous_headings":"","what":"Get structure and information of a 'fusen' built package for developers — get_package_structure","title":"Get structure and information of a 'fusen' built package for developers — get_package_structure","text":"Get structure information 'fusen' built package developers Draw tree package structure console","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/get_package_structure.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get structure and information of a 'fusen' built package for developers — get_package_structure","text":"","code":"get_package_structure(config_file, emoji = TRUE, silent = FALSE) draw_package_structure(structure_list, silent = FALSE)"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/get_package_structure.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get structure and information of a 'fusen' built package for developers — get_package_structure","text":"config_file Path source configuration file get structure emoji Add emojis output silent Whether print messages structure_list list information package issued [get_package_structure()]","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/get_package_structure.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get structure and information of a 'fusen' built package for developers — get_package_structure","text":"list information package","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/get_package_structure.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get structure and information of a 'fusen' built package for developers — get_package_structure","text":"","code":"if (FALSE) { # This only works inside a 'fusen' built package pkg_structure <- get_package_structure() draw_package_structure(pkg_structure) } # Example with a dummy package dummypackage <- tempfile(\"drawpkg.structure\") dir.create(dummypackage) # {fusen} steps fill_description(pkg = dummypackage, fields = list(Title = \"Dummy Package\")) dev_file <- suppressMessages( add_flat_template(pkg = dummypackage, overwrite = TRUE, open = FALSE) ) flat_file <- dev_file[grepl(\"flat_\", dev_file)] usethis::with_project(dummypackage, { # Add an extra R file with internal function # to list in \"keep\" dir.create(\"R\") cat(\"extra_fun <- function() {1}\\n\", file = \"R/my_extra_fun.R\") # Works with classical package pkg_structure <- get_package_structure() draw_package_structure(pkg_structure) }) #> ✔ Setting active project to '/tmp/RtmpERNo3g/drawpkg.structure17e85690424a' #> ── No NAMESPACE file found there: /tmp/RtmpERNo3g/drawpkg.structure17e85690424a #> ── keep ──────────────────────────────────────────────────────────────────────── #> #> - keep #> - path #> + keep #> - state #> + 🍏 active #> - R #> - R/my_extra_fun.R #> + 🙈 extra_fun #> - tests #> - vignettes #> ✔ Setting active project to '' usethis::with_project(dummypackage, { # Works with 'fusen' package suppressMessages( inflate( pkg = dummypackage, flat_file = flat_file, vignette_name = \"Get started\", check = FALSE, open_vignette = FALSE ) ) pkg_structure <- get_package_structure() draw_package_structure(pkg_structure) }) #> ✔ Setting active project to '/tmp/RtmpERNo3g/drawpkg.structure17e85690424a' #> ── config file for dev/flat_full.Rmd ─────────────────────────────────────────── #> ── Reading NAMESPACE file ────────────────────────────────────────────────────── #> ── flat_full.Rmd ─────────────────────────────────────────────────────────────── #> ── keep ──────────────────────────────────────────────────────────────────────── #> #> - flat_full.Rmd #> - flat_title #> + flat_full.Rmd for working package #> - path #> + dev/flat_full.Rmd #> - state #> + 🍏 active #> - R #> - R/my_median.R #> + 👀 my_median #> - R/my_other_median.R #> + 👀 my_other_median #> + 🙈 sub_median #> - tests #> + tests/testthat/test-my_median.R #> + tests/testthat/test-my_other_median.R #> - vignettes #> + vignettes/get-started.Rmd #> - keep #> - path #> + keep #> - state #> + 🍏 active #> - R #> - R/my_extra_fun.R #> + 🙈 extra_fun #> - tests #> - vignettes #> ✔ Setting active project to ''"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/inflate.html","id":null,"dir":"Reference","previous_headings":"","what":"Inflate Rmd to package — inflate","title":"Inflate Rmd to package — inflate","text":"Inflate Rmd package","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/inflate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Inflate Rmd to package — inflate","text":"","code":"inflate( pkg = \".\", flat_file, vignette_name = \"Get started\", open_vignette = TRUE, check = TRUE, document = TRUE, overwrite = \"ask\", clean = \"ask\", update_params = TRUE, ... )"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/inflate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Inflate Rmd to package — inflate","text":"pkg Path package flat_file Path Rmarkdown file inflate vignette_name Character. Title resulting vignette. Use NA want create vignette. open_vignette Logical. Whether open vignette file end process check Logical. Whether check package Rmd inflating document Logical. Whether document package using att_amend_desc overwrite Logical (TRUE, FALSE) character (\"ask\", \"yes\", \"). Whether overwrite vignette functions already exists. clean Logical (TRUE, FALSE) character (\"ask\", \"yes\", \") Whether delete files anymore created current flat file. Typically, deleted renamed function flat file. Default \"ask\". update_params Logical. Whether update inflate parameters configuration file. ... Arguments passed devtools::check(). example, can inflate(check = TRUE, quiet = TRUE), quiet passed devtools::check().","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/inflate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Inflate Rmd to package — inflate","text":"Package structure. Return path current package.","code":""},{"path":[]},{"path":"https://thinkr-open.github.io/fusen/dev/reference/inflate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Inflate Rmd to package — inflate","text":"","code":"# Create a new project dummypackage <- tempfile(\"dummy.package\") dir.create(dummypackage) # {fusen} steps dev_file <- add_flat_template(template = \"full\", pkg = dummypackage, overwrite = TRUE) #> Created file .here in /tmp/RtmpERNo3g/dummy.package17e82e653ad7 . 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\")) inflate( pkg = dummypackage, flat_file = flat_file, vignette_name = \"Exploration of my Data\", check = FALSE ) #> ✔ Setting active project to '/tmp/RtmpERNo3g/dummy.package17e82e653ad7' #> ℹ Loading dummy.package17e82e653ad7 #> Writing NAMESPACE #> ✔ Adding 'knitr' to Suggests field in DESCRIPTION #> • Use `requireNamespace(\"knitr\", quietly = TRUE)` to test if package is installed #> • Then directly refer to functions with `knitr::fun()` #> ✔ Adding 'inst/doc' to '.gitignore' #> ── config file for dev/flat_full.Rmd ─────────────────────────────────────────── #> ✔ R: R/my_median.R was added to the config file #> ✔ R: R/my_other_median.R was added to the config file #> ✔ tests: tests/testthat/test-my_median.R was added to the config file #> ✔ tests: tests/testthat/test-my_other_median.R was added to the config file #> ✔ vignettes: vignettes/exploration-of-my-data.Rmd was added to the config file #> Saving attachment parameters to yaml config file #> Updating dummy.package17e82e653ad7 documentation #> ℹ Loading dummy.package17e82e653ad7 #> Writing NAMESPACE #> Writing my_median.Rd #> Writing my_other_median.Rd #> Writing sub_median.Rd #> ℹ Loading dummy.package17e82e653ad7 #> [+] 3 package(s) added: stats, rmarkdown, testthat. # Explore directory of the package # browseURL(dummypackage) # Try pkgdown build # usethis::use_pkgdown() # pkgdown::build_site(dummypackage) # Delete dummy package unlink(dummypackage, recursive = TRUE)"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/inflate_all.html","id":null,"dir":"Reference","previous_headings":"","what":"Inflate all your flat files — inflate_all","title":"Inflate all your flat files — inflate_all","text":"Inflate flat files stored \"dev/\" starting \"flat_\"","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/inflate_all.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Inflate all your flat files — inflate_all","text":"","code":"inflate_all( pkg = \".\", document = TRUE, check = TRUE, open_vignette = FALSE, overwrite = TRUE, check_unregistered = TRUE, stylers, ... ) inflate_all_no_check( pkg = \".\", document = TRUE, open_vignette = FALSE, overwrite = TRUE, check_unregistered = TRUE, stylers, ... )"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/inflate_all.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Inflate all your flat files — inflate_all","text":"pkg Path package document Logical. Whether document package using att_amend_desc check Logical. Whether check package Rmd inflating open_vignette Logical. Whether open vignette file end process overwrite Logical (TRUE, FALSE) character (\"ask\", \"yes\", \"). Whether overwrite vignette functions already exists. check_unregistered Logical. Whether help detect unregistered files. Typically files created flat file added manually repository. stylers Function run end process, like styler::style_pkg lintr::lint_package lambda function combining functions like: function() {styler::style_pkg(); lintr::lint_package()}. unique function, use format without parenthesis () end command. ... Arguments passed devtools::check(). example, can inflate(check = TRUE, quiet = TRUE), quiet passed devtools::check().","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/inflate_all.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Inflate all your flat files — inflate_all","text":"side effect. Inflates flat files can inflated.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/inflate_all.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Inflate all your flat files — inflate_all","text":"requires inflate() flat files individually least , specific inflate configurations stored. also requires register R, tests vignettes files package, even created inflate. Run inflate_all() read messages. first time, probably need run register_all_to_config() package new. information, read vignette(\"inflate---flat-files\", package = \"fusen\")","code":""},{"path":[]},{"path":"https://thinkr-open.github.io/fusen/dev/reference/inflate_all.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Inflate all your flat files — inflate_all","text":"","code":"if (FALSE) { # Usually, in the current package run inflate_all() directly # These functions change the current user workspace inflate_all() # Or inflate_all_no_check() to prevent checks to run inflate_all_no_check() # Or inflate with the styler you want inflate_all(stylers = styler::style_pkg) } # You can also inflate_all flats of another package as follows # Example with a dummy package with a flat file dummypackage <- tempfile(\"inflateall.otherpkg\") dir.create(dummypackage) fill_description(pkg = dummypackage, fields = list(Title = \"Dummy Package\")) flat_files <- add_minimal_package( pkg = dummypackage, overwrite = TRUE, open = FALSE ) #> Created file .here in /tmp/RtmpERNo3g/inflateall.otherpkg17e82c3fedd2 . Please start a new R session in the new project directory. flat_file <- flat_files[grep(\"flat\", basename(flat_files))] # Inflate the flat file once usethis::with_project(dummypackage, { # if you are starting from a brand new package, inflate_all() will crash # it's because of the absence of a fusen config file # # inflate_all() # will crash # Add licence usethis::use_mit_license(\"John Doe\") # you need to inflate manually your flat file first inflate( pkg = dummypackage, flat_file = flat_file, vignette_name = \"Get started\", check = FALSE, open_vignette = FALSE, document = TRUE, overwrite = \"yes\" ) # your config file has been created config_yml_ref <- yaml::read_yaml(getOption(\"fusen.config_file\", default = \"dev/config_fusen.yaml\")) }) #> ✔ Setting active project to '/tmp/RtmpERNo3g/inflateall.otherpkg17e82c3fedd2' #> ✔ Adding 'MIT + file LICENSE' to License #> ✔ Writing 'LICENSE' #> ✔ Writing 'LICENSE.md' #> ✔ Adding '^LICENSE\\\\.md$' to '.Rbuildignore' #> ℹ Loading inflateall.otherpkg17e82c3fedd2 #> Writing NAMESPACE #> ✔ Adding 'knitr' to Suggests field in DESCRIPTION #> • Use `requireNamespace(\"knitr\", quietly = TRUE)` to test if package is installed #> • Then directly refer to functions with `knitr::fun()` #> ✔ Adding 'inst/doc' to '.gitignore' #> ── config file for dev/flat_minimal.Rmd ──────────────────────────────────────── #> ✔ R: R/my_fun.R was added to the config file #> ✔ tests: tests/testthat/test-my_fun.R was added to the config file #> ✔ vignettes: vignettes/get-started.Rmd was added to the config file #> Saving attachment parameters to yaml config file #> Updating inflateall.otherpkg17e82c3fedd2 documentation #> ℹ Loading inflateall.otherpkg17e82c3fedd2 #> Writing NAMESPACE #> Writing my_fun.Rd #> ℹ Loading inflateall.otherpkg17e82c3fedd2 #> [+] 2 package(s) added: rmarkdown, testthat. #> ✔ Setting active project to '/tmp/RtmpERNo3g/dummy.package17e82e653ad7' # Next time, you can run inflate_all() directly usethis::with_project(dummypackage, { # now you can run inflate_all() inflate_all(check = FALSE, document = TRUE) }) #> ✔ Setting active project to '/tmp/RtmpERNo3g/inflateall.otherpkg17e82c3fedd2' #> ✔ The flat file flat_minimal.Rmd is going to be inflated #> ── config file for dev/flat_minimal.Rmd ──────────────────────────────────────── #> ── check not registered files ────────────────────────────────────────────────── #> ✔ There are no unregistered files. #> Documentation parameters were restored from attachment config file. #> Updating inflateall.otherpkg17e82c3fedd2 documentation #> ℹ Loading inflateall.otherpkg17e82c3fedd2 #> Writing NAMESPACE #> ℹ Loading inflateall.otherpkg17e82c3fedd2 #> ✔ Setting active project to '/tmp/RtmpERNo3g/dummy.package17e82e653ad7' # Clean the temporary directory unlink(dummypackage, recursive = TRUE)"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/init_share_on_github.html","id":null,"dir":"Reference","previous_headings":"","what":"Initiate GitHub to share your package on a website — init_share_on_github","title":"Initiate GitHub to share your package on a website — init_share_on_github","text":"uses 'pkgdown' share documentation package GitHub Actions. may need run usethis::create_github_token(), gitcreds::gitcreds_set() .","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/init_share_on_github.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Initiate GitHub to share your package on a website — init_share_on_github","text":"","code":"init_share_on_github(ask = TRUE, organisation = NULL)"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/init_share_on_github.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Initiate GitHub to share your package on a website — init_share_on_github","text":"ask Logical. TRUE (default) ask user apply instructions time needed, FALSE user already know . organisation supplied, repo created organisation, instead login associated GitHub token discovered host. user's role token's scopes must permission create repositories organisation.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/init_share_on_github.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Initiate GitHub to share your package on a website — init_share_on_github","text":"URL website created","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/init_share_on_github.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Initiate GitHub to share your package on a website — init_share_on_github","text":"init_share_on_github() runs multiple steps able share proper package GitHub: Start versionning git already Connect GitHub account Create minimal DESCRIPTION file missing update content information deployment Add NEWS file present modifications releases Add README.Rmd knit README.md quickly present aim use package Init continuous integration (CI) Check package Linux, Windows MacOS Calculate code coverage. Note may need connect https://.codecov.io/ see results code coverage. Init continuous deployment (CD) 'pkgdown' website documentation Commit push GitHub List remaining manual steps make website public Read vignette(\"share---github-website\", package = \"fusen\")","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/init_share_on_github.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Initiate GitHub to share your package on a website — init_share_on_github","text":"","code":"if (FALSE) { # This modifies the current directory and send it on GitHub init_share_on_github() }"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/load_flat_functions.html","id":null,"dir":"Reference","previous_headings":"","what":"Load the code of all 'function' chunk in a flat file — load_flat_functions","title":"Load the code of all 'function' chunk in a flat file — load_flat_functions","text":"Load code 'function' chunk flat file","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/load_flat_functions.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Load the code of all 'function' chunk in a flat file — load_flat_functions","text":"","code":"load_flat_functions(flat_file, envir = globalenv())"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/load_flat_functions.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Load the code of all 'function' chunk in a flat file — load_flat_functions","text":"flat_file Path flat load functions envir environment expr evaluated. May also NULL, list, data frame, pairlist integer specified sys.call.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/load_flat_functions.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Load the code of all 'function' chunk in a flat file — load_flat_functions","text":"Path flat file loaded. Used side effect: Load functions global environment.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/load_flat_functions.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Load the code of all 'function' chunk in a flat file — load_flat_functions","text":"","code":"if (FALSE) { # Use this command directly in the console fusen::load_flat_functions() # Or choose a flat file to load functions from load_flat_functions(flat_file = \"dev/flat_full.Rmd\") load_flat_functions(flat_file = \"dev/flat_clean_fusen_files.Rmd\") }"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/pipe.html","id":null,"dir":"Reference","previous_headings":"","what":"Pipe operator — %>%","title":"Pipe operator — %>%","text":"See magrittr::%>% details.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/pipe.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pipe operator — %>%","text":"","code":"lhs %>% rhs"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/pipe.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pipe operator — %>%","text":"lhs value magrittr placeholder. rhs function call using magrittr semantics.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/pipe.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pipe operator — %>%","text":"result calling rhs(lhs).","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/register_all_to_config.html","id":null,"dir":"Reference","previous_headings":"","what":"Include all existing package files in the config file — register_all_to_config","title":"Include all existing package files in the config file — register_all_to_config","text":"Helps transition non-fusen packages made earlier version","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/register_all_to_config.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Include all existing package files in the config file — register_all_to_config","text":"","code":"register_all_to_config(pkg = \".\", config_file)"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/register_all_to_config.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Include all existing package files in the config file — register_all_to_config","text":"pkg Path package add file configuration file config_file Path configuration file","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/register_all_to_config.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Include all existing package files in the config file — register_all_to_config","text":"Invisible path 'fusen' configuration file","code":""},{"path":[]},{"path":"https://thinkr-open.github.io/fusen/dev/reference/register_all_to_config.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Include all existing package files in the config file — register_all_to_config","text":"","code":"if (FALSE) { # Usually run this one inside the current project # Note: running this will write \"dev/config_fusen.yaml\" in your working directory register_all_to_config() } # Or you can try on the reproducible example dummypackage <- tempfile(\"register\") dir.create(dummypackage) # {fusen} steps fill_description(pkg = dummypackage, fields = list(Title = \"Dummy Package\")) dev_file <- suppressMessages(add_flat_template(pkg = dummypackage, overwrite = TRUE, open = FALSE)) flat_file <- dev_file[grepl(\"flat_\", dev_file)] # Inflate once usethis::with_project(dummypackage, { suppressMessages( inflate( pkg = dummypackage, flat_file = flat_file, vignette_name = \"Get started\", check = FALSE, open_vignette = FALSE ) ) out_path <- register_all_to_config(dummypackage) # Look at the output yaml::read_yaml(out_path) }) #> ✔ Setting active project to '/tmp/RtmpERNo3g/register17e855cfb805' #> ── config file for dev/flat_full.Rmd ─────────────────────────────────────────── #> ✔ There are no unregistered files. #> There is no file to register or everything was already registered #> ✔ Setting active project to '/tmp/RtmpERNo3g/dummy.package17e82e653ad7' #> $flat_full.Rmd #> $flat_full.Rmd$path #> [1] \"dev/flat_full.Rmd\" #> #> $flat_full.Rmd$state #> [1] \"active\" #> #> $flat_full.Rmd$R #> [1] \"R/my_median.R\" \"R/my_other_median.R\" #> #> $flat_full.Rmd$tests #> [1] \"tests/testthat/test-my_median.R\" #> [2] \"tests/testthat/test-my_other_median.R\" #> #> $flat_full.Rmd$vignettes #> [1] \"vignettes/get-started.Rmd\" #> #> $flat_full.Rmd$inflate #> $flat_full.Rmd$inflate$flat_file #> [1] \"dev/flat_full.Rmd\" #> #> $flat_full.Rmd$inflate$vignette_name #> [1] \"Get started\" #> #> $flat_full.Rmd$inflate$open_vignette #> [1] FALSE #> #> $flat_full.Rmd$inflate$check #> [1] FALSE #> #> $flat_full.Rmd$inflate$document #> [1] TRUE #> #> $flat_full.Rmd$inflate$overwrite #> [1] \"ask\" #> #> $flat_full.Rmd$inflate$clean #> [1] \"ask\" #> #> #>"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/rename_flat_file.html","id":null,"dir":"Reference","previous_headings":"","what":"Rename a flat file — rename_flat_file","title":"Rename a flat file — rename_flat_file","text":"Rename flat file","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/rename_flat_file.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rename a flat file — rename_flat_file","text":"","code":"rename_flat_file(flat_file, new_name)"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/rename_flat_file.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rename a flat file — rename_flat_file","text":"flat_file Path flat file rename new_name New name flat file","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/rename_flat_file.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Rename a flat file — rename_flat_file","text":"Used side effect. Flat file renamed, config file updated, inflated files modified needed.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/rename_flat_file.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Rename a flat file — rename_flat_file","text":"","code":"if (FALSE) { # These functions change the current user workspace dev_file <- suppressMessages( add_flat_template( template = \"add\", pkg = \".\", overwrite = TRUE, open = FALSE ) ) rename_flat_file( flat_file = \"dev/flat_additional.Rmd\", new_name = \"flat_new.Rmd\" ) }"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/sepuku.html","id":null,"dir":"Reference","previous_headings":"","what":"Clean a package from fusen-related files and tags — sepuku","title":"Clean a package from fusen-related files and tags — sepuku","text":"function delete flat files (.e files listed fusen configuration file, well rmd qmd files starting \"flat\" \"dev/\" \"dev/flat_history\" folders). also remove fusen-related tags added calls fusen::inflate() files located \"R/\", \"tests/\" \"vignettes/\" folders. Finally, also remove fusen configuration file exists.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/sepuku.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Clean a package from fusen-related files and tags — sepuku","text":"","code":"sepuku(pkg = \".\", force = FALSE)"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/sepuku.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Clean a package from fusen-related files and tags — sepuku","text":"pkg Character. Path current package force logical. whether force cleaning , without asking user sure making operation (default: FALSE)","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/sepuku.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Clean a package from fusen-related files and tags — sepuku","text":"side effect. package cleaned fusen-related files tags","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/sepuku.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Clean a package from fusen-related files and tags — sepuku","text":"","code":"if (FALSE) { sepuku() # If you want to force the cleaning, you can use the force argument sepuku(force = TRUE) # Example with a dummy package dummypackage <- tempfile(\"sepuku.example\") dir.create(dummypackage) fill_description(pkg = dummypackage, fields = list(Title = \"Dummy Package\")) usethis::with_project(dummypackage, { # Add licence usethis::use_mit_license(\"John Doe\") dir.create(file.path(dummypackage, \"dev\")) dir.create(file.path(dummypackage, \"dev\", \"flat_history\")) # We add 2 flat files in the package and inflate them dev_file1 <- add_minimal_flat( pkg = dummypackage, flat_name = \"flat1.Rmd\", open = FALSE ) dev_file2 <- add_minimal_flat( pkg = dummypackage, flat_name = \"flat2.Rmd\", open = FALSE ) inflate( pkg = dummypackage, flat_file = dev_file1, vignette_name = \"Get started\", check = FALSE, open_vignette = FALSE, document = TRUE, overwrite = \"yes\" ) inflate( pkg = dummypackage, flat_file = dev_file2, vignette_name = \"Get started 2\", check = FALSE, open_vignette = FALSE, document = TRUE, overwrite = \"yes\" ) # We deprecate the first flat file, which will be moved to the flat_history folder deprecate_flat_file( file.path(dummypackage, \"dev\", \"flat_flat1.Rmd\") ) # We create 2 flat files with the qmd extension file.create(file.path(dummypackage, \"dev\", \"flat_history\", \"flat_old.qmd\")) file.create(file.path(dummypackage, \"dev\", \"flat_qmd.qmd\")) sepuku(force = TRUE) # We check that the fusen configuration file has been deleted file.exists( file.path(dummypackage, \"dev\", \"config_fusen.yaml\") ) # We check that all the flat files have been deleted length( list.files(file.path(dummypackage, \"dev\"), pattern = \"^flat.*\\\\.Rmd\" ) ) length( list.files(file.path(dummypackage, \"dev\"), pattern = \"^flat.*\\\\.qmd\" ) ) length( list.files(file.path(dummypackage, \"dev\", \"flat_history\"), pattern = \"^flat.*\\\\.Rmd\" ) ) length( list.files(file.path(dummypackage, \"dev\", \"flat_history\"), pattern = \"^flat.*\\\\.qmd\" ) ) # We check that all the files with fusen tags have been cleaned length(fusen:::find_files_with_fusen_tags(pkg = dummypackage)) }) # Clean the temporary directory unlink(dummypackage, recursive = TRUE) }"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/sepuku_utils.html","id":null,"dir":"Reference","previous_headings":"","what":"List all flat files present in the package — list_flat_files","title":"List all flat files present in the package — list_flat_files","text":"Search flat files listed fusen config file, rmd qmd files starting \"flat_\" dev/ folder, dev/flat_history folder","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/sepuku_utils.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"List all flat files present in the package — list_flat_files","text":"","code":"list_flat_files(pkg = \".\")"},{"path":"https://thinkr-open.github.io/fusen/dev/reference/sepuku_utils.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"List all flat files present in the package — list_flat_files","text":"pkg Path package","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/reference/sepuku_utils.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"List all flat files present in the package — list_flat_files","text":"vector flat files paths","code":""},{"path":[]},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"new-features-0-6-0-9001","dir":"Changelog","previous_headings":"","what":"New features","title":"fusen (development version 0.6.0.9001)","text":"Adding sepuku(), allowing remove traces fusen-related files tags package (#257 #258 #259) @ymansiaux","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"fusen-060","dir":"Changelog","previous_headings":"","what":"fusen 0.6.0","title":"fusen 0.6.0","text":"CRAN release: 2024-05-14","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"breaking-changes-0-6-0","dir":"Changelog","previous_headings":"","what":"Breaking changes","title":"fusen 0.6.0","text":"{fusen} now relies {lightparser} instead {parsermd} parse flat file. allows avoid installation problems {parsermd}, updated anymore. {lightparser} lighter, may unattended effects specific flat file cases. Please report issue may encounter. (#233) inflate_all*() use parameter clean anymore. Use check_unregistered instead check files registered configuration file.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"new-features-0-6-0","dir":"Changelog","previous_headings":"","what":"New features","title":"fusen 0.6.0","text":"draw_package_structure() along get_package_structure() allows draw package structure functions created R file, whether exported (#189) rename_flat_file() allows rename flat file, deals config inflated files deprecate_flat_file() helps properly deprecate flat file, modifies config file cleans previously inflated files inflate() detects functions renamed removed allow clean package repository (#24) Allow organisation init_share_on_github() send GitHub organisation Fix load_flat_functions() work VSCode","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"fusen-052","dir":"Changelog","previous_headings":"","what":"fusen 0.5.2","title":"fusen 0.5.2","text":"CRAN release: 2023-08-17","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"new-features-0-5-2","dir":"Changelog","previous_headings":"","what":"New features","title":"fusen 0.5.2","text":"Allow styler function parameter stylers inflate_all*() (e.g inflate_all(stylers = styler::style_pkg))","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"minor-changes-0-5-2","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"fusen 0.5.2","text":"Fix use packageVersion() character Allow “.” current package adding flat file without DESCRIPTION (#224)","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"fusen-051","dir":"Changelog","previous_headings":"","what":"fusen 0.5.1","title":"fusen 0.5.1","text":"CRAN release: 2023-06-29","code":""},{"path":[]},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"inflate-all-active-flat-file-0-5-1","dir":"Changelog","previous_headings":"New features","what":"Inflate all active flat file","title":"fusen 0.5.1","text":"inflate_all() uses configuration file inflate flat files . document check options thus run flat files. (#204, @ymansiaux) requires run inflate() least flat file. also requires register files, present package version ‘fusen’ register_all_to_config()","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"list-all-files-created-with-an-inflate-in-a-config-file-with-parameters-0-5-1","dir":"Changelog","previous_headings":"New features","what":"List all files created with an inflate() in a config file with parameters","title":"fusen 0.5.1","text":"inflate() creates configuration file “dev/config_fusen.yaml” register files created inflating corresponding flat file, along inflate parameters (#198, @ymansiaux)","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"breaking-changes-0-5-1","dir":"Changelog","previous_headings":"","what":"Breaking changes","title":"fusen 0.5.1","text":"Arguments rmd name function inflate() now lead errors (Deprecated since v0.3.0). add_dev_history() deprecated since v0.3.0 favor add_flat_template(). Now add_dev_history() adds “dev_history.Rmd” file “dev/” directory. add_flat_template(template = \"minimal\") longer exists avoid confusion minimal package minimal flat file. Indeed, now add_flat_template(template = \"minimal_package\") (also add_minimal_package()) add_flat_template(template = \"minimal_flat\") (also add_minimal_flat()). latter exactly add_additional() (#187) create_fusen() still uses minimal minimal_package","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"bug-fixes-0-5-1","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"fusen 0.5.1","text":"Fix using line break function name flat files (#142, @FlorenceMounier) project directory renamed “.package (Copy)”, inflate() still works, even name proper package name. important DESCRIPTION Package name correct.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"major-changes-0-5-1","dir":"Changelog","previous_headings":"","what":"Major changes","title":"fusen 0.5.1","text":"create_fusen() RStudio gui interface now accept flat_file parameter name first flat file well first function (using ‘minimal’ template). tips tricks vignette shortly presents combine {fusen} {golem} (#187) Incorrect function names issued addins add_flat_template() cleaned included flat file follow underscore rule.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"minor-changes-0-5-1","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"fusen 0.5.1","text":"Update CONTRIBUTING speak flat file {fusen} replace maintainer’s name fill_description() examples, templates tests (#155, @FlorenceMounier) create_fusen() vaccinates created git project (#171) Examples function roxygen documentation cleaned extra spaces empty #' avoid git diff code linters / stylers.","code":""},{"path":[]},{"path":[]},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"publish-your-package-website-on-github-0-5-0","dir":"Changelog","previous_headings":"New features","what":"Publish your package website on GitHub","title":"fusen 0.5.0","text":"Publish {fusen} project GitHub website one command: init_share_on_github()","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"list-all-files-created-with-an-inflate-in-a-config-file-0-5-0","dir":"Changelog","previous_headings":"New features","what":"List all files created with an inflate() in a config file","title":"fusen 0.5.0","text":"inflate() creates “dev/config_fusen.yaml” file register files created inflating corresponding flat file (First steps #24) Migrate non-fusen package previous version ‘fusen’ register_all_to_config() Create update config file data.frame df_to_config() list legitimate scripts (even associated flat file)","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"others-0-5-0","dir":"Changelog","previous_headings":"New features","what":"Others","title":"fusen 0.5.0","text":"Allow multiple examples function (#149)","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"bug-fixes-0-5-0","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"fusen 0.5.0","text":"Fix using word “function(” documentation (#174, @FlorenceMounier)","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"fusen-042","dir":"Changelog","previous_headings":"","what":"fusen 0.4.2","title":"fusen 0.4.2","text":"CRAN release: 2023-06-07","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"bug-0-4-2","dir":"Changelog","previous_headings":"","what":"Bug","title":"fusen 0.4.2","text":"Replacement unexported usethis functions (#205, @ateucher)","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"fusen-041","dir":"Changelog","previous_headings":"","what":"fusen 0.4.1","title":"fusen 0.4.1","text":"CRAN release: 2022-09-29","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"new-features-0-4-1","dir":"Changelog","previous_headings":"","what":"New features","title":"fusen 0.4.1","text":"Load function chunks flat file currently opened load_flat_functions() (Like load_all() flat file) Allow inflate() Quarto “.qmd” flat file (#160)","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"minor-0-4-1","dir":"Changelog","previous_headings":"","what":"Minor","title":"fusen 0.4.1","text":"Fix HTML5 doc","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"fusen-040","dir":"Changelog","previous_headings":"","what":"fusen 0.4.0","title":"fusen 0.4.0","text":"CRAN release: 2022-04-30","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"new-features-0-4-0","dir":"Changelog","previous_headings":"","what":"New features","title":"fusen 0.4.0","text":"inflate() current opened flat file flat_file empty (#138) Add rmarkdown template additional flat file RStudio Add wrappers around add_flat_template() lazy devs: add_additional(), add_full(), add_minimal() Show “flat_template” origin files generated {fusen} (@ ALanguillaume) Allow inflate(vignette_name = c(\"Super title\" = \"01-Super Slug\")) nice Title different vignette Entry (#87) Get author date flat file vignette (#129)","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"bug-fixes-0-4-0","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"fusen 0.4.0","text":"Read DESCRIPTION file package name available (#144 @VincentGuyader) Read nyc_squirrels encoding avoid encoding problems use_data() Allow flat files tests Extract yaml metadata flat file, like author date include inflated vignette Simplify “flat_teaching” unique simple function Fix asciify_name() account diacritics (@ ALanguillaume) Improve template ‘full’ internal data use Fix tests git exists","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"fusen-030","dir":"Changelog","previous_headings":"","what":"fusen 0.3.0","title":"fusen 0.3.0","text":"CRAN release: 2021-12-16","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"breaking-changes-0-3-0","dir":"Changelog","previous_headings":"","what":"Breaking changes","title":"fusen 0.3.0","text":"add_flat_template() superseeds add_dev_history() advanced possibilities add_dev_history() deprecated Vignette name create now set inflate(vignette_name = \"Get started\") instead name Flat name inflate now set inflate(flat_file = \"dev/flat_full.Rmd\") instead rmd","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"major-changes-0-3-0","dir":"Changelog","previous_headings":"","what":"Major changes","title":"fusen 0.3.0","text":"Check included now uses devtools::check() instead rcmdcheck() Avoid creating vignette inflate(vignette_name = NA) Decide whether open vignette inflate inflate(open_vignette = FALSE) Improve documentation included flat templates reflect changes using dev_history file Add RStudio Addin insert new flat template Add RStudio Addin insert chunks new function (@ColinFay) Deal \\dontrun{} example chunks Allow short names chunks: dev, fun, ex, test create_fusen() create {fusen} project command line RStudio new project (@ALanguillaume) Add “edit hand” files generated","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"grouping-functions-under-the-same-file-0-3-0","dir":"Changelog","previous_headings":"Major changes","what":"Grouping functions under the same file","title":"fusen 0.3.0","text":"Group functions R file test file (level 1 + level 2) titles Rmd Group functions R file test file @rdname roxygen tag Group functions R file test file @filename roxygen tag (recognized ‘fusen’) Group functions R file test file function chunk get chunk option {r function-my_func, filename = \"my_filename\"}","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"minor-changes-0-3-0","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"fusen 0.3.0","text":"add_flat_template() uses flat_name pre-fill template first function name. Fix .onLoad functions file creation Allow R6Class() function chunks Fix inflate function chunks data package documentation Fix inflate empty functions chunks Fix filename inflate templates new calls add_dev_history() (@Cervangirard) Default vignette name now “Get started” creating “vignettes/get-started.Rmd” open files saved using inflate() {RStudioapi} works Ask restart RStudio first inflate","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"fusen-024","dir":"Changelog","previous_headings":"","what":"fusen 0.2.4","title":"fusen 0.2.4","text":"CRAN release: 2021-08-04 Update vignette tests","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"fusen-023","dir":"Changelog","previous_headings":"","what":"fusen 0.2.3","title":"fusen 0.2.3","text":"CRAN release: 2021-07-26 Update unit tests Show check outputs console Ask overwriting everything Check Description Title description fields Check folder name correct package name","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"fusen-022","dir":"Changelog","previous_headings":"","what":"fusen 0.2.2","title":"fusen 0.2.2","text":"CRAN release: 2021-07-09 Protect tests older Pandoc versions","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"fusen-021","dir":"Changelog","previous_headings":"","what":"fusen 0.2.1","title":"fusen 0.2.1","text":"CRAN release: 2021-07-08 Fix documentation issues CRAN Add templates “dev_history.Rmd” file Add informative messages users New vignette explain maintain {fusen} package","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"fusen-020","dir":"Changelog","previous_headings":"","what":"fusen 0.2.0","title":"fusen 0.2.0","text":"Prepare CRAN","code":""},{"path":[]},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"features-0-1-1","dir":"Changelog","previous_headings":"","what":"features","title":"fusen 0.1.1","text":"Allow non-clean vignette name Allow different “dev_history” templates: “full”, “minimal” “additional”","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"documentation-0-1-1","dir":"Changelog","previous_headings":"","what":"documentation","title":"fusen 0.1.1","text":"Add vignette explain maintain package {fusen} Add vignette explain deal data Added NEWS.md file track changes package.","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"tests-0-1-1","dir":"Changelog","previous_headings":"","what":"tests","title":"fusen 0.1.1","text":"Add tests corner cases Rmd templates","code":""},{"path":"https://thinkr-open.github.io/fusen/dev/news/index.html","id":"fusen-010","dir":"Changelog","previous_headings":"","what":"fusen 0.1.0","title":"fusen 0.1.0","text":"First release","code":""}] diff --git a/dev/sitemap.xml b/dev/sitemap.xml index 3cd6dae..466b882 100644 --- a/dev/sitemap.xml +++ b/dev/sitemap.xml @@ -36,6 +36,9 @@ https://thinkr-open.github.io/fusen/dev/articles/share-on-a-github-website.html + + https://thinkr-open.github.io/fusen/dev/articles/switch-from-a-package-developed-with-fusen-to-a-classical-package.html + https://thinkr-open.github.io/fusen/dev/articles/tips-and-tricks.html @@ -99,4 +102,10 @@ https://thinkr-open.github.io/fusen/dev/reference/rename_flat_file.html + + https://thinkr-open.github.io/fusen/dev/reference/sepuku.html + + + https://thinkr-open.github.io/fusen/dev/reference/sepuku_utils.html +