pkg = system.file(package="fundoc")
(scripts = file.path(pkg, "*.R"))
-#> [1] "C:/Users/rd/AppData/Local/Temp/RtmpeQgXBf/temp_libpath104d0642020d3/fundoc/*.R"
+#> [1] "C:/Users/rd/AppData/Local/Temp/Rtmpyoxil6/temp_libpathe18826921c0d/fundoc/*.R"
if (FALSE) {
fundoc(scripts,
out_dir = "docs/reference/docs",
diff --git a/docs/search.json b/docs/search.json
index 2c2cf19..897c971 100644
--- a/docs/search.json
+++ b/docs/search.json
@@ -1 +1 @@
-[{"path":"http://yongfu.name/fundoc/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Yongfu Liao. Author, maintainer.","code":""},{"path":"http://yongfu.name/fundoc/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Liao Y (2023). fundoc: Quick dirty function documentation. R package version 0.0.1.","code":"@Manual{, title = {fundoc: Quick and dirty function documentation}, author = {Yongfu Liao}, year = {2023}, note = {R package version 0.0.1}, }"},{"path":"http://yongfu.name/fundoc/index.html","id":"quick-and-dirty-function-documentation","dir":"","previous_headings":"","what":"Quick and dirty function documentation","title":"Quick and dirty function documentation","text":"package generate function documentation along evaluated example code list R scripts documented Roxygen comments. function documentation generated R files package can found . build documentation, clone repo, set working directory, execute code R:","code":"library(fundoc) fundoc(\"R\", out_dir = \"docs/reference/docs\", proj_name = \"fundoc\", proj_title = \"Quick and Dirty Function Documentation\")"},{"path":"http://yongfu.name/fundoc/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2023 fundoc authors 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":"http://yongfu.name/fundoc/reference/expand_Rscript.html","id":null,"dir":"Reference","previous_headings":"","what":"File path handler — expand_Rscript","title":"File path handler — expand_Rscript","text":"File path handler","code":""},{"path":"http://yongfu.name/fundoc/reference/expand_Rscript.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"File path handler — expand_Rscript","text":"","code":"expand_Rscript(fps, debug = F)"},{"path":"http://yongfu.name/fundoc/reference/expand_Rscript.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"File path handler — expand_Rscript","text":"fps character vector paths. vector can mix paths either (1) directory paths, (2) file paths, (3) glob expressions R scripts. Note (2) (3) must end .R .r. debug Logical. Whether return results list fps names.","code":""},{"path":"http://yongfu.name/fundoc/reference/expand_Rscript.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"File path handler — expand_Rscript","text":"character vector list.","code":""},{"path":"http://yongfu.name/fundoc/reference/expand_Rscript.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"File path handler — expand_Rscript","text":"","code":"expand_Rscript = fundoc:::expand_Rscript dir_ = system.file(package = \"fundoc\") (a_file = file.path(dir_, \"foo.R\")) #> [1] \"C:/Users/rd/AppData/Local/Temp/RtmpeQgXBf/temp_libpath104d0642020d3/fundoc/foo.R\" expand_Rscript(a_file) #> [1] \"C:/Users/rd/AppData/Local/Temp/RtmpeQgXBf/temp_libpath104d0642020d3/fundoc/foo.R\" (a_dir = file.path(dir_, \"R\")) #> [1] \"C:/Users/rd/AppData/Local/Temp/RtmpeQgXBf/temp_libpath104d0642020d3/fundoc/R\" expand_Rscript(a_dir) #> [1] \"C:/Users/rd/AppData/Local/Temp/RtmpeQgXBf/temp_libpath104d0642020d3/fundoc/R/a.R\" (a_glob = file.path(dir_, \"*\", \"*.R\")) #> [1] \"C:/Users/rd/AppData/Local/Temp/RtmpeQgXBf/temp_libpath104d0642020d3/fundoc/*/*.R\" expand_Rscript(a_glob) #> [1] \"C:/Users/rd/AppData/Local/Temp/RtmpeQgXBf/temp_libpath104d0642020d3/fundoc/R/a.R\" # Mix file paths expand_Rscript( c(a_file, a_dir, a_glob) ) #> [1] \"C:/Users/rd/AppData/Local/Temp/RtmpeQgXBf/temp_libpath104d0642020d3/fundoc/foo.R\" #> [2] \"C:/Users/rd/AppData/Local/Temp/RtmpeQgXBf/temp_libpath104d0642020d3/fundoc/R/a.R\" expand_Rscript( c(a_file, a_dir, a_glob), debug = T ) #> $`C:/Users/rd/AppData/Local/Temp/RtmpeQgXBf/temp_libpath104d0642020d3/fundoc/foo.R` #> [1] \"C:/Users/rd/AppData/Local/Temp/RtmpeQgXBf/temp_libpath104d0642020d3/fundoc/foo.R\" #> #> $`C:/Users/rd/AppData/Local/Temp/RtmpeQgXBf/temp_libpath104d0642020d3/fundoc/R` #> [1] \"C:/Users/rd/AppData/Local/Temp/RtmpeQgXBf/temp_libpath104d0642020d3/fundoc/R/a.R\" #> #> $`C:/Users/rd/AppData/Local/Temp/RtmpeQgXBf/temp_libpath104d0642020d3/fundoc/*/*.R` #> [1] \"C:/Users/rd/AppData/Local/Temp/RtmpeQgXBf/temp_libpath104d0642020d3/fundoc/R/a.R\" #>"},{"path":"http://yongfu.name/fundoc/reference/fundoc.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate documentation from R scripts — fundoc","title":"Generate documentation from R scripts — fundoc","text":"Generate documentation R scripts","code":""},{"path":"http://yongfu.name/fundoc/reference/fundoc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate documentation from R scripts — fundoc","text":"","code":"fundoc( scripts = \".\", out_dir = \"docs\", proj_name = NULL, proj_title = NULL, version = NULL, quiet = FALSE )"},{"path":"http://yongfu.name/fundoc/reference/fundoc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate documentation from R scripts — fundoc","text":"scripts character vector paths. vector can mix paths either (1) directory paths, (2) file paths, (3) glob expressions R scripts. Note (2) (3) must end .R .r. See expand_Rscript() details. proj_name Character. name project. Must conform conventions naming R packages. check whether name valid, refer https://github.com/r-lib/available. Defaults NULL, generates name Foo.{YYYY.MM.DD} according current date. proj_title Character. one-sentence title project . Defaults NULL, generates title format: Function documentation project {proj_name}. version Character. Version number project. Defaults \"0.0.1\" set NULL. quiet Logical. Whether hide messages subprocess compiling function documentation. Defaults FALSE. outdir Path generated documentation directory.","code":""},{"path":"http://yongfu.name/fundoc/reference/fundoc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate documentation from R scripts — fundoc","text":"","code":"pkg = system.file(package=\"fundoc\") (scripts = file.path(pkg, \"*.R\")) #> [1] \"C:/Users/rd/AppData/Local/Temp/RtmpeQgXBf/temp_libpath104d0642020d3/fundoc/*.R\" if (FALSE) { fundoc(scripts, out_dir = \"docs/reference/docs\", proj_name = \"fundoc\", proj_title = \"Quick and Dirty Function Documentation\") }"},{"path":"http://yongfu.name/fundoc/reference/locate_description.html","id":null,"dir":"Reference","previous_headings":"","what":"Locate DESCRIPTION content from a bunch of files — locate_description","title":"Locate DESCRIPTION content from a bunch of files — locate_description","text":"Given vector file paths, function tries find parse R script DESCRIPTION content written Roxygen docstring beginning file. one file contain DESCRIPTION content, first one parsed returned.","code":""},{"path":"http://yongfu.name/fundoc/reference/locate_description.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Locate DESCRIPTION content from a bunch of files — locate_description","text":"","code":"locate_description(files)"},{"path":"http://yongfu.name/fundoc/reference/locate_description.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Locate DESCRIPTION content from a bunch of files — locate_description","text":"files character vector file paths.","code":""},{"path":"http://yongfu.name/fundoc/reference/parse_description_in_script.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract embedded DESCRIPTION content in an R script — parse_description_in_script","title":"Extract embedded DESCRIPTION content in an R script — parse_description_in_script","text":"Extract embedded DESCRIPTION content R script","code":""},{"path":"http://yongfu.name/fundoc/reference/parse_description_in_script.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract embedded DESCRIPTION content in an R script — parse_description_in_script","text":"","code":"parse_description_in_script(fp)"},{"path":"http://yongfu.name/fundoc/reference/parse_description_in_script.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract embedded DESCRIPTION content in an R script — parse_description_in_script","text":"","code":"fp = system.file(\"foo.R\", package=\"fundoc\") xfun::file_string(fp) #> #' @DESCRIPTION #> #' Package: pkgTest #> #' Title: Some test #> #' Version: 0.0.0.9000 #> #' Authors@R: #> #' person(\"First\", \"Last\", , \"first.last@example.com\", role = c(\"aut\", \"cre\"), #> #' comment = c(ORCID = \"YOUR-ORCID-ID\")) #> #' Description: What the package does (one paragraph). #> #> library(dplyr) #> #> #' A Foo Function #> #' #> #' Gets species from iris #> #' #> #' @param species Character vector. #> #' @return Data Frame. #> #' @export #> #' @importFrom dplyr filter #> #' @examples #> #' foo() #> foo = function(species = \"setosa\") { #> iris |> #> filter( Species == {{ species }} ) |> #> head() #> } #> #> #' Foo2 #> #' #> #' A plot #> #' #> #' @export #> #' @examples #> #' foo2() #> foo2 = function() { #> plot(1:3, 1:3, pch=19) #> } #> fundoc:::parse_description_in_script(fp) |> cat() #> Package: pkgTest #> Title: Some test #> Version: 0.0.0.9000 #> Authors@R: #> person(\"First\", \"Last\", , \"first.last@example.com\", role = c(\"aut\", \"cre\"), #> comment = c(ORCID = \"YOUR-ORCID-ID\")) #> Description: What the package does (one paragraph)."},{"path":"http://yongfu.name/fundoc/reference/stack_fps.html","id":null,"dir":"Reference","previous_headings":"","what":"Print vector of paths as lines — stack_fps","title":"Print vector of paths as lines — stack_fps","text":"Print vector paths lines","code":""},{"path":"http://yongfu.name/fundoc/reference/stack_fps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print vector of paths as lines — stack_fps","text":"","code":"stack_fps(fps, indent = \" \")"},{"path":"http://yongfu.name/fundoc/reference/stack_fps.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Print vector of paths as lines — stack_fps","text":"","code":"fundoc:::stack_fps(LETTERS[1:3]) #> [1] \" A\\n B\\n C\""}]
+[{"path":"http://yongfu.name/fundoc/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Yongfu Liao. Author, maintainer.","code":""},{"path":"http://yongfu.name/fundoc/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Liao Y (2023). fundoc: Quick dirty function documentation. R package version 0.0.1.","code":"@Manual{, title = {fundoc: Quick and dirty function documentation}, author = {Yongfu Liao}, year = {2023}, note = {R package version 0.0.1}, }"},{"path":"http://yongfu.name/fundoc/index.html","id":"quick-and-dirty-function-documentation","dir":"","previous_headings":"","what":"Quick and dirty function documentation","title":"Quick and dirty function documentation","text":"fundoc created documenting functions R scripts structured R package. Although structure R packages provides fantastic framework document one’s work, reality, many R users unfamiliar highly technical workflow developing R packages. package tries bridge technical gap exposing benefits roxygen2 documentation individual R scripts. purpose provide perfect tool rather simple enough tool get one started documenting scripts. need worry structuring R scripts package. Stick existing workflow, document functions, let fundoc::fundoc() worry generating HTML documentation website. prerequisite learn roxygen2 basics.","code":""},{"path":"http://yongfu.name/fundoc/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"Quick and dirty function documentation","text":"example function documentation generated R files fundoc can found . build documentation, clone repo, set working directory, execute code R:","code":"library(fundoc) fundoc(\"R\", out_dir = \"docs/reference/docs\", proj_name = \"fundoc\", proj_title = \"Quick and Dirty Function Documentation\")"},{"path":"http://yongfu.name/fundoc/index.html","id":"motivation","dir":"","previous_headings":"","what":"Motivation","title":"Quick and dirty function documentation","text":"Many functions written data analyses works package development poorly documented. One reasons may lack framework (associated tools) writing documentation outside world R package development. addition, many R users simply unaware possibility turning one’s work R package enhance reproducibility leveraging documentation testing framework provided devtools ecosystem. Nonetheless, documentation still great importance works besides package development. fundoc leverages conventions devtools ecosystem generate documentation. basically wrapper around [usethis::create_package()] [knitr::knit_rd()] set temporary package template generating HTML function documentation. , fuss automatically generating documentation pages abstracted away, users focus documenting individual R scripts roxygen2 comments. Note since fundoc utilizes devtools framework, logic writing documenting functions R scripts must consistent package development. may conflict users’ existing habits organizing scripts (e.g., mixing function definitions function calls script sourcing external scripts). Yet suggest users adjust accordingly package development conventions since long-term benefit plan stick R. Understanding workflow package development must become serious R user.","code":""},{"path":"http://yongfu.name/fundoc/index.html","id":"tips-to-reduce-hassles-with-roxygen-documentation","dir":"","previous_headings":"","what":"Tips to reduce hassles with roxygen documentation","title":"Quick and dirty function documentation","text":"provide tips may help bypass obstacles can run documenting R scripts without fully understanding package development workflow. Classify scripts two types Type-scripts function definition Type-II scripts (R Markdown) analyses Define document (roxygen2 comments) functions Type-scripts. source external scripts Type-scripts. Functions defined Type-scripts available Type-scripts. fact, can conceive Type-scripts concatenating form single script. sourcing single script R console, need worry dependencies defined functions. previous tip suggests analysis script/Rmd, import functions Type-scripts sourcing beginning, R markdown example : documenting functions Type-scripts, might want include @examples tag function. allow demonstrate use function verbatim code form. fundoc::fundoc() help execute code examples record insert output generated documentation website. amounts rudimentary form testing functions. use @examples tags, also recommend adding @export tag every function. function run properly @examples, need use pkg:::func() notation function documentation @export tag. Understanding requires technical details package development. keep things simple, just remember include EVERY function @export tag. workflow recommended may force adapt lots code functions. use tidyverse lot, may find article Programming dplyr helpful.","code":"## Analysis ```{r} # Import Type-I scripts source(\"funcDef1.R\") source(\"funcDef2.R\") source(\"funcDef3.R\") ``` Blah blah blah ```{r} # Some analysis code ```"},{"path":"http://yongfu.name/fundoc/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2023 fundoc authors 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":"http://yongfu.name/fundoc/reference/expand_Rscript.html","id":null,"dir":"Reference","previous_headings":"","what":"File path handler — expand_Rscript","title":"File path handler — expand_Rscript","text":"File path handler","code":""},{"path":"http://yongfu.name/fundoc/reference/expand_Rscript.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"File path handler — expand_Rscript","text":"","code":"expand_Rscript(fps, debug = F)"},{"path":"http://yongfu.name/fundoc/reference/expand_Rscript.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"File path handler — expand_Rscript","text":"fps character vector paths. vector can mix either (1) directory paths, (2) file paths, (3) glob expressions R scripts. Note (2) (3) must end .R .r. See expand_Rscript() details. debug Logical. Whether return results list fps names.","code":""},{"path":"http://yongfu.name/fundoc/reference/expand_Rscript.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"File path handler — expand_Rscript","text":"character vector list.","code":""},{"path":"http://yongfu.name/fundoc/reference/expand_Rscript.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"File path handler — expand_Rscript","text":"","code":"expand_Rscript = fundoc:::expand_Rscript dir_ = system.file(package = \"fundoc\") (a_file = file.path(dir_, \"foo.R\")) #> [1] \"C:/Users/rd/AppData/Local/Temp/Rtmpyoxil6/temp_libpathe18826921c0d/fundoc/foo.R\" expand_Rscript(a_file) #> [1] \"C:/Users/rd/AppData/Local/Temp/Rtmpyoxil6/temp_libpathe18826921c0d/fundoc/foo.R\" (a_dir = file.path(dir_, \"R\")) #> [1] \"C:/Users/rd/AppData/Local/Temp/Rtmpyoxil6/temp_libpathe18826921c0d/fundoc/R\" expand_Rscript(a_dir) #> [1] \"C:/Users/rd/AppData/Local/Temp/Rtmpyoxil6/temp_libpathe18826921c0d/fundoc/R/a.R\" (a_glob = file.path(dir_, \"*\", \"*.R\")) #> [1] \"C:/Users/rd/AppData/Local/Temp/Rtmpyoxil6/temp_libpathe18826921c0d/fundoc/*/*.R\" expand_Rscript(a_glob) #> [1] \"C:/Users/rd/AppData/Local/Temp/Rtmpyoxil6/temp_libpathe18826921c0d/fundoc/R/a.R\" # Mix file paths expand_Rscript( c(a_file, a_dir, a_glob) ) #> [1] \"C:/Users/rd/AppData/Local/Temp/Rtmpyoxil6/temp_libpathe18826921c0d/fundoc/foo.R\" #> [2] \"C:/Users/rd/AppData/Local/Temp/Rtmpyoxil6/temp_libpathe18826921c0d/fundoc/R/a.R\" expand_Rscript( c(a_file, a_dir, a_glob), debug = T ) #> $`C:/Users/rd/AppData/Local/Temp/Rtmpyoxil6/temp_libpathe18826921c0d/fundoc/foo.R` #> [1] \"C:/Users/rd/AppData/Local/Temp/Rtmpyoxil6/temp_libpathe18826921c0d/fundoc/foo.R\" #> #> $`C:/Users/rd/AppData/Local/Temp/Rtmpyoxil6/temp_libpathe18826921c0d/fundoc/R` #> [1] \"C:/Users/rd/AppData/Local/Temp/Rtmpyoxil6/temp_libpathe18826921c0d/fundoc/R/a.R\" #> #> $`C:/Users/rd/AppData/Local/Temp/Rtmpyoxil6/temp_libpathe18826921c0d/fundoc/*/*.R` #> [1] \"C:/Users/rd/AppData/Local/Temp/Rtmpyoxil6/temp_libpathe18826921c0d/fundoc/R/a.R\" #>"},{"path":"http://yongfu.name/fundoc/reference/fundoc-package.html","id":null,"dir":"Reference","previous_headings":"","what":"fundoc: Quick and dirty function documentation — fundoc-package","title":"fundoc: Quick and dirty function documentation — fundoc-package","text":"Generate function documentation along evaluated examples R scripts documented Roxygen comments","code":""},{"path":"http://yongfu.name/fundoc/reference/fundoc-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"fundoc: Quick and dirty function documentation — fundoc-package","text":"Maintainer: Yongfu Liao liao961120@gmail.com (ORCID)","code":""},{"path":"http://yongfu.name/fundoc/reference/fundoc.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate documentation from R scripts — fundoc","title":"Generate documentation from R scripts — fundoc","text":"Generate documentation R scripts","code":""},{"path":"http://yongfu.name/fundoc/reference/fundoc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate documentation from R scripts — fundoc","text":"","code":"fundoc( scripts = \".\", out_dir = \"docs\", proj_name = NULL, proj_title = NULL, version = NULL, quiet = FALSE )"},{"path":"http://yongfu.name/fundoc/reference/fundoc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate documentation from R scripts — fundoc","text":"scripts character vector paths. vector can mix either (1) directory paths, (2) file paths, (3) glob expressions R scripts. Note (2) (3) must end .R .r. See expand_Rscript() details. proj_name Character. name project. Must conform conventions naming R packages. check whether name valid, refer https://github.com/r-lib/available. Defaults NULL, generates name Foo.{YYYY.MM.DD} according current date. proj_title Character. one-sentence title project . Defaults NULL, generates title format: Function documentation project {proj_name}. version Character. Version number project. Defaults \"0.0.1\" set NULL. quiet Logical. Whether hide messages subprocess compiling function documentation. Defaults FALSE. outdir Path generated documentation directory.","code":""},{"path":"http://yongfu.name/fundoc/reference/fundoc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate documentation from R scripts — fundoc","text":"","code":"pkg = system.file(package=\"fundoc\") (scripts = file.path(pkg, \"*.R\")) #> [1] \"C:/Users/rd/AppData/Local/Temp/Rtmpyoxil6/temp_libpathe18826921c0d/fundoc/*.R\" if (FALSE) { fundoc(scripts, out_dir = \"docs/reference/docs\", proj_name = \"fundoc\", proj_title = \"Quick and Dirty Function Documentation\") }"},{"path":"http://yongfu.name/fundoc/reference/locate_description.html","id":null,"dir":"Reference","previous_headings":"","what":"Locate DESCRIPTION content from a bunch of files — locate_description","title":"Locate DESCRIPTION content from a bunch of files — locate_description","text":"Given vector file paths, function tries find parse R script DESCRIPTION content written Roxygen docstring beginning file. one file contain DESCRIPTION content, first one parsed returned.","code":""},{"path":"http://yongfu.name/fundoc/reference/locate_description.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Locate DESCRIPTION content from a bunch of files — locate_description","text":"","code":"locate_description(files)"},{"path":"http://yongfu.name/fundoc/reference/locate_description.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Locate DESCRIPTION content from a bunch of files — locate_description","text":"files character vector file paths.","code":""},{"path":"http://yongfu.name/fundoc/reference/parse_description_in_script.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract embedded DESCRIPTION content in an R script — parse_description_in_script","title":"Extract embedded DESCRIPTION content in an R script — parse_description_in_script","text":"Extract embedded DESCRIPTION content R script","code":""},{"path":"http://yongfu.name/fundoc/reference/parse_description_in_script.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract embedded DESCRIPTION content in an R script — parse_description_in_script","text":"","code":"parse_description_in_script(fp)"},{"path":"http://yongfu.name/fundoc/reference/parse_description_in_script.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract embedded DESCRIPTION content in an R script — parse_description_in_script","text":"","code":"fp = system.file(\"foo.R\", package=\"fundoc\") xfun::file_string(fp) #> #' @DESCRIPTION #> #' Package: pkgTest #> #' Title: Some test #> #' Version: 0.0.0.9000 #> #' Authors@R: #> #' person(\"First\", \"Last\", , \"first.last@example.com\", role = c(\"aut\", \"cre\"), #> #' comment = c(ORCID = \"YOUR-ORCID-ID\")) #> #' Description: What the package does (one paragraph). #> #> library(dplyr) #> #> #' A Foo Function #> #' #> #' Gets species from iris #> #' #> #' @param species Character vector. #> #' @return Data Frame. #> #' @export #> #' @importFrom dplyr filter #> #' @examples #> #' foo() #> foo = function(species = \"setosa\") { #> iris |> #> filter( Species == {{ species }} ) |> #> head() #> } #> #> #' Foo2 #> #' #> #' A plot #> #' #> #' @export #> #' @examples #> #' foo2() #> foo2 = function() { #> plot(1:3, 1:3, pch=19) #> } #> fundoc:::parse_description_in_script(fp) |> cat() #> Package: pkgTest #> Title: Some test #> Version: 0.0.0.9000 #> Authors@R: #> person(\"First\", \"Last\", , \"first.last@example.com\", role = c(\"aut\", \"cre\"), #> comment = c(ORCID = \"YOUR-ORCID-ID\")) #> Description: What the package does (one paragraph)."},{"path":"http://yongfu.name/fundoc/reference/stack_fps.html","id":null,"dir":"Reference","previous_headings":"","what":"Print vector of paths as lines — stack_fps","title":"Print vector of paths as lines — stack_fps","text":"Print vector paths lines","code":""},{"path":"http://yongfu.name/fundoc/reference/stack_fps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print vector of paths as lines — stack_fps","text":"","code":"stack_fps(fps, indent = \" \")"},{"path":"http://yongfu.name/fundoc/reference/stack_fps.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Print vector of paths as lines — stack_fps","text":"","code":"fundoc:::stack_fps(LETTERS[1:3]) #> [1] \" A\\n B\\n C\""}]
diff --git a/docs/sitemap.xml b/docs/sitemap.xml
index 4751e4e..f39286f 100644
--- a/docs/sitemap.xml
+++ b/docs/sitemap.xml
@@ -24,6 +24,9 @@
http://yongfu.name/fundoc/reference/docs/expand_Rscript.html
+
+ http://yongfu.name/fundoc/reference/docs/fundoc-package.html
+
http://yongfu.name/fundoc/reference/docs/fundoc.html
@@ -42,6 +45,9 @@
http://yongfu.name/fundoc/reference/expand_Rscript.html
+
+ http://yongfu.name/fundoc/reference/fundoc-package.html
+
http://yongfu.name/fundoc/reference/fundoc.html
diff --git a/man/expand_Rscript.Rd b/man/expand_Rscript.Rd
index 7f70788..3f94fc6 100644
--- a/man/expand_Rscript.Rd
+++ b/man/expand_Rscript.Rd
@@ -7,10 +7,10 @@
expand_Rscript(fps, debug = F)
}
\arguments{
-\item{fps}{A character vector of paths. The vector can be a mix of paths
-of either (1) directory paths, (2) file paths, or (3) glob
-expressions to R scripts. Note that (2) and (3) must end with
-\code{.R} or \code{.r}.}
+\item{fps}{A character vector of paths. The vector can be a mix of either
+(1) directory paths, (2) file paths, or (3) glob expressions to
+R scripts. Note that (2) and (3) must end with \code{.R} or \code{.r}.
+See \code{\link[=expand_Rscript]{expand_Rscript()}} for details.}
\item{debug}{Logical. Whether to return results as a list with \code{fps}
as names.}
diff --git a/man/fundoc-package.Rd b/man/fundoc-package.Rd
new file mode 100644
index 0000000..3951306
--- /dev/null
+++ b/man/fundoc-package.Rd
@@ -0,0 +1,14 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/fundoc-package.R
+\docType{package}
+\name{fundoc-package}
+\alias{fundoc-package}
+\title{fundoc: Quick and dirty function documentation}
+\description{
+Generate function documentation along with evaluated examples from R scripts documented in Roxygen comments
+}
+\author{
+\strong{Maintainer}: Yongfu Liao \email{liao961120@gmail.com} (\href{https://orcid.org/0000-0002-1814-2993}{ORCID})
+
+}
+\keyword{internal}
diff --git a/man/fundoc.Rd b/man/fundoc.Rd
index 5e15bdc..1b7864b 100644
--- a/man/fundoc.Rd
+++ b/man/fundoc.Rd
@@ -14,10 +14,10 @@ fundoc(
)
}
\arguments{
-\item{scripts}{A character vector of paths. The vector can be a mix of paths
-of either (1) directory paths, (2) file paths, or (3) glob
-expressions to R scripts. Note that (2) and (3) must end with
-\code{.R} or \code{.r}. See \code{\link[=expand_Rscript]{expand_Rscript()}} for details.}
+\item{scripts}{A character vector of paths. The vector can be a mix of either
+(1) directory paths, (2) file paths, or (3) glob expressions to
+R scripts. Note that (2) and (3) must end with \code{.R} or \code{.r}.
+See \code{\link[=expand_Rscript]{expand_Rscript()}} for details.}
\item{proj_name}{Character. The name of the project. Must conform to
conventions of naming R packages. To check whether a name is valid,