├── .github ├── .gitignore └── workflows │ └── pkgdown.yaml ├── vignettes ├── .gitignore ├── 4_fig_2_noaalogo.rdata ├── E_thispkgwasbuiltusing.Rmd └── csl.csl ├── LICENSE ├── docs ├── logo.png ├── favicon.ico ├── favicon-16x16.png ├── favicon-32x32.png ├── package-logo.png ├── apple-touch-icon.png ├── reference │ ├── Rplot001.png │ ├── crossref-1.png │ ├── figures │ │ ├── logo.png │ │ ├── logo.pptx │ │ ├── buildReport.JPG │ │ ├── refpptx_nmfs.JPG │ │ ├── refdoc_noaa_tech_memo.JPG │ │ ├── folder_output_post_run.JPG │ │ ├── folder_architecture_post_buildReport.JPG │ │ └── refdoc_fisheries_economics_of_the_us.JPG │ ├── ref_figtab-1.png │ ├── save_figures-1.png │ ├── save_graphs-1.png │ ├── ref_listobject-1.png │ └── CreateMetadata.html ├── apple-touch-icon-120x120.png ├── apple-touch-icon-152x152.png ├── apple-touch-icon-180x180.png ├── apple-touch-icon-60x60.png ├── apple-touch-icon-76x76.png ├── man │ └── figures │ │ ├── buildReport.JPG │ │ ├── refpptx_nmfs.JPG │ │ ├── folder_output_post_run.JPG │ │ ├── refdoc_noaa_tech_memo.JPG │ │ ├── folder_architecture_post_buildReport.JPG │ │ └── refdoc_fisheries_economics_of_the_us.JPG ├── 5624caeb15464c07518bb1f2b4f9de1f.ico.zip ├── articles │ ├── C_functions-to-help-write-report_files │ │ ├── figure-html │ │ │ ├── G1c-1.png │ │ │ ├── G2c-1.png │ │ │ ├── unnamed-chunk-18-1.png │ │ │ ├── unnamed-chunk-20-1.png │ │ │ ├── unnamed-chunk-3-1.png │ │ │ ├── unnamed-chunk-5-1.png │ │ │ ├── unnamed-chunk-7-1.png │ │ │ └── unnamed-chunk-9-1.png │ │ ├── header-attrs-2.8 │ │ │ └── header-attrs.js │ │ ├── header-attrs-2.10 │ │ │ └── header-attrs.js │ │ └── tabwid-1.0.0 │ │ │ └── tabwid.css │ ├── A_use-buildReport_files │ │ ├── header-attrs-2.8 │ │ │ └── header-attrs.js │ │ └── header-attrs-2.10 │ │ │ └── header-attrs.js │ ├── B_run-script-demo_files │ │ ├── header-attrs-2.8 │ │ │ └── header-attrs.js │ │ └── header-attrs-2.10 │ │ │ └── header-attrs.js │ ├── D_googledrive_files │ │ ├── header-attrs-2.10 │ │ │ └── header-attrs.js │ │ └── header-attrs-2.8 │ │ │ └── header-attrs.js │ ├── E_thispkgwasbuiltusing_files │ │ └── header-attrs-2.10 │ │ │ └── header-attrs.js │ └── index.html ├── pkgdown.yml ├── link.svg ├── bootstrap-toc.css ├── docsearch.js ├── extra.css ├── pkgdown.js ├── sitemap.xml ├── bootstrap-toc.js ├── LICENSE-text.html └── news │ └── index.html ├── tests ├── testthat.R └── testthat │ └── test-my-test.R ├── NEWS.md ├── inst ├── img │ ├── Noaa1.png │ ├── favicon.ico │ ├── Noaa_logo.jpg │ ├── noaa-gray.png │ ├── noaa_logo.gif │ ├── DeptOfCommerce.jpg │ ├── NOAA_Logo_Full.jpg │ ├── noaa_logo_pos.png │ ├── noaa_logo_reverse.png │ ├── noaa_fisheries_small.png │ ├── FISHERIES_Logo_WEB_ONLY.png │ └── NOAA_Fisheries_logo_vertical.png ├── icons │ ├── favicon.ico │ ├── apple-icon.png │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── favicon-96x96.png │ ├── ms-icon-70x70.png │ ├── ms-icon-144x144.png │ ├── ms-icon-150x150.png │ ├── ms-icon-310x310.png │ ├── android-icon-36x36.png │ ├── android-icon-48x48.png │ ├── android-icon-72x72.png │ ├── android-icon-96x96.png │ ├── apple-icon-114x114.png │ ├── apple-icon-120x120.png │ ├── apple-icon-144x144.png │ ├── apple-icon-152x152.png │ ├── apple-icon-180x180.png │ ├── apple-icon-57x57.png │ ├── apple-icon-60x60.png │ ├── apple-icon-72x72.png │ ├── apple-icon-76x76.png │ ├── android-icon-144x144.png │ ├── android-icon-192x192.png │ ├── apple-icon-precomposed.png │ ├── 5624caeb15464c07518bb1f2b4f9de1f.ico.zip │ ├── browserconfig.xml │ ├── manifest.json │ └── ref.txt ├── rmd │ ├── refppt_NMFS.pptx │ ├── refdoc_noaa_tech_memo.docx │ ├── word-styles-reference.docx │ ├── refdoc_fisheries_economics_of_the_us.docx │ ├── 1_data.R │ ├── 1_blank.R │ ├── _TableFigureHeader.Rmd │ ├── header.yaml │ ├── 0_blank.Rmd │ ├── 1_dataDL.R │ ├── 0_endmatter.Rmd │ ├── 0_coverpage.Rmd │ ├── 0_presentation.Rmd │ ├── bib_example.bib │ ├── 0_figtab.Rmd │ ├── _child_save_eq.Rmd │ ├── 0_frontmatter.Rmd │ ├── run.R │ ├── 1_functions.R │ ├── 1_directories.R │ └── _child_save_fig.Rmd └── cite │ └── bulletin-of-marine-science.csl ├── man ├── figures │ ├── logo.png │ ├── logo.pptx │ ├── buildReport.JPG │ ├── refpptx_nmfs.JPG │ ├── folder_output_post_run.JPG │ ├── refdoc_noaa_tech_memo.JPG │ ├── folder_architecture_post_buildReport.JPG │ └── refdoc_fisheries_economics_of_the_us.JPG ├── create_metadata.Rd ├── stndth.Rd ├── auto_counter.Rd ├── df2js.Rd ├── TitleCase.Rd ├── numbers2words.Rd ├── xunitspct.Rd ├── numbers2words_th.Rd ├── url_exists.Rd ├── tolower2.Rd ├── mod_number.Rd ├── pchange.Rd ├── numbers0.Rd ├── is_something_in_this_matrix.Rd ├── text_list.Rd ├── xunits.Rd ├── format_cells.Rd ├── googledrive_txt_dl.Rd ├── range_text.Rd ├── theme_flextable_nmfstm.Rd ├── save_equations.Rd ├── crossref.Rd ├── add_table_footnotes.Rd ├── save_tables.Rd ├── save_figures.Rd └── buildReport.Rd ├── pkgdown ├── favicon │ ├── favicon.ico │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── apple-touch-icon.png │ ├── apple-touch-icon-60x60.png │ ├── apple-touch-icon-76x76.png │ ├── apple-touch-icon-120x120.png │ ├── apple-touch-icon-152x152.png │ └── apple-touch-icon-180x180.png ├── extra.css └── _pkgdown.yml ├── presentations └── 2021-06-05NMFSReports-RCascadiaConf.pdf ├── .gitignore ├── .Rbuildignore ├── NMFSReports.Rproj ├── doc ├── E_thispkgwasbuiltusing.R ├── E_thispkgwasbuiltusing.Rmd ├── D_googledrive.R ├── D_googledrive.Rmd └── A_use-buildReport.R ├── NAMESPACE ├── LICENSE.md ├── DESCRIPTION ├── notes.R ├── README.Rmd └── README.md /.github/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | -------------------------------------------------------------------------------- /vignettes/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | *.R 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2021 2 | COPYRIGHT HOLDER: Emily Markowitz 3 | -------------------------------------------------------------------------------- /docs/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/logo.png -------------------------------------------------------------------------------- /tests/testthat.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(NMFSReports) 3 | 4 | test_check("NMFSReports") 5 | -------------------------------------------------------------------------------- /NEWS.md: -------------------------------------------------------------------------------- 1 | # NMFSReports 0.0.0.9000 2 | 3 | * Added a `NEWS.md` file to track changes to the package. 4 | -------------------------------------------------------------------------------- /docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/favicon.ico -------------------------------------------------------------------------------- /inst/img/Noaa1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/img/Noaa1.png -------------------------------------------------------------------------------- /inst/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/img/favicon.ico -------------------------------------------------------------------------------- /man/figures/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/man/figures/logo.png -------------------------------------------------------------------------------- /tests/testthat/test-my-test.R: -------------------------------------------------------------------------------- 1 | test_that("multiplication works", { 2 | expect_equal(2 * 2, 4) 3 | }) 4 | -------------------------------------------------------------------------------- /docs/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/favicon-16x16.png -------------------------------------------------------------------------------- /docs/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/favicon-32x32.png -------------------------------------------------------------------------------- /docs/package-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/package-logo.png -------------------------------------------------------------------------------- /inst/icons/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/icons/favicon.ico -------------------------------------------------------------------------------- /inst/img/Noaa_logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/img/Noaa_logo.jpg -------------------------------------------------------------------------------- /inst/img/noaa-gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/img/noaa-gray.png -------------------------------------------------------------------------------- /inst/img/noaa_logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/img/noaa_logo.gif -------------------------------------------------------------------------------- /man/figures/logo.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/man/figures/logo.pptx -------------------------------------------------------------------------------- /docs/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/apple-touch-icon.png -------------------------------------------------------------------------------- /inst/icons/apple-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/icons/apple-icon.png -------------------------------------------------------------------------------- /inst/rmd/refppt_NMFS.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/rmd/refppt_NMFS.pptx -------------------------------------------------------------------------------- /docs/reference/Rplot001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/reference/Rplot001.png -------------------------------------------------------------------------------- /inst/icons/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/icons/favicon-16x16.png -------------------------------------------------------------------------------- /inst/icons/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/icons/favicon-32x32.png -------------------------------------------------------------------------------- /inst/icons/favicon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/icons/favicon-96x96.png -------------------------------------------------------------------------------- /inst/icons/ms-icon-70x70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/icons/ms-icon-70x70.png -------------------------------------------------------------------------------- /inst/img/DeptOfCommerce.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/img/DeptOfCommerce.jpg -------------------------------------------------------------------------------- /inst/img/NOAA_Logo_Full.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/img/NOAA_Logo_Full.jpg -------------------------------------------------------------------------------- /inst/img/noaa_logo_pos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/img/noaa_logo_pos.png -------------------------------------------------------------------------------- /man/figures/buildReport.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/man/figures/buildReport.JPG -------------------------------------------------------------------------------- /man/figures/refpptx_nmfs.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/man/figures/refpptx_nmfs.JPG -------------------------------------------------------------------------------- /pkgdown/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/pkgdown/favicon/favicon.ico -------------------------------------------------------------------------------- /docs/reference/crossref-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/reference/crossref-1.png -------------------------------------------------------------------------------- /inst/icons/ms-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/icons/ms-icon-144x144.png -------------------------------------------------------------------------------- /inst/icons/ms-icon-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/icons/ms-icon-150x150.png -------------------------------------------------------------------------------- /inst/icons/ms-icon-310x310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/icons/ms-icon-310x310.png -------------------------------------------------------------------------------- /inst/img/noaa_logo_reverse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/img/noaa_logo_reverse.png -------------------------------------------------------------------------------- /docs/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /docs/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /docs/apple-touch-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/apple-touch-icon-180x180.png -------------------------------------------------------------------------------- /docs/apple-touch-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/apple-touch-icon-60x60.png -------------------------------------------------------------------------------- /docs/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /docs/man/figures/buildReport.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/man/figures/buildReport.JPG -------------------------------------------------------------------------------- /docs/man/figures/refpptx_nmfs.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/man/figures/refpptx_nmfs.JPG -------------------------------------------------------------------------------- /docs/reference/figures/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/reference/figures/logo.png -------------------------------------------------------------------------------- /docs/reference/figures/logo.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/reference/figures/logo.pptx -------------------------------------------------------------------------------- /docs/reference/ref_figtab-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/reference/ref_figtab-1.png -------------------------------------------------------------------------------- /docs/reference/save_figures-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/reference/save_figures-1.png -------------------------------------------------------------------------------- /docs/reference/save_graphs-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/reference/save_graphs-1.png -------------------------------------------------------------------------------- /inst/icons/android-icon-36x36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/icons/android-icon-36x36.png -------------------------------------------------------------------------------- /inst/icons/android-icon-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/icons/android-icon-48x48.png -------------------------------------------------------------------------------- /inst/icons/android-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/icons/android-icon-72x72.png -------------------------------------------------------------------------------- /inst/icons/android-icon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/icons/android-icon-96x96.png -------------------------------------------------------------------------------- /inst/icons/apple-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/icons/apple-icon-114x114.png -------------------------------------------------------------------------------- /inst/icons/apple-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/icons/apple-icon-120x120.png -------------------------------------------------------------------------------- /inst/icons/apple-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/icons/apple-icon-144x144.png -------------------------------------------------------------------------------- /inst/icons/apple-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/icons/apple-icon-152x152.png -------------------------------------------------------------------------------- /inst/icons/apple-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/icons/apple-icon-180x180.png -------------------------------------------------------------------------------- /inst/icons/apple-icon-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/icons/apple-icon-57x57.png -------------------------------------------------------------------------------- /inst/icons/apple-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/icons/apple-icon-60x60.png -------------------------------------------------------------------------------- /inst/icons/apple-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/icons/apple-icon-72x72.png -------------------------------------------------------------------------------- /inst/icons/apple-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/icons/apple-icon-76x76.png -------------------------------------------------------------------------------- /inst/img/noaa_fisheries_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/img/noaa_fisheries_small.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/pkgdown/favicon/favicon-16x16.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/pkgdown/favicon/favicon-32x32.png -------------------------------------------------------------------------------- /vignettes/4_fig_2_noaalogo.rdata: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/vignettes/4_fig_2_noaalogo.rdata -------------------------------------------------------------------------------- /docs/reference/ref_listobject-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/reference/ref_listobject-1.png -------------------------------------------------------------------------------- /inst/icons/android-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/icons/android-icon-144x144.png -------------------------------------------------------------------------------- /inst/icons/android-icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/icons/android-icon-192x192.png -------------------------------------------------------------------------------- /inst/rmd/refdoc_noaa_tech_memo.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/rmd/refdoc_noaa_tech_memo.docx -------------------------------------------------------------------------------- /inst/rmd/word-styles-reference.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/rmd/word-styles-reference.docx -------------------------------------------------------------------------------- /docs/reference/figures/buildReport.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/reference/figures/buildReport.JPG -------------------------------------------------------------------------------- /inst/icons/apple-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/icons/apple-icon-precomposed.png -------------------------------------------------------------------------------- /inst/img/FISHERIES_Logo_WEB_ONLY.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/img/FISHERIES_Logo_WEB_ONLY.png -------------------------------------------------------------------------------- /man/figures/folder_output_post_run.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/man/figures/folder_output_post_run.JPG -------------------------------------------------------------------------------- /man/figures/refdoc_noaa_tech_memo.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/man/figures/refdoc_noaa_tech_memo.JPG -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/pkgdown/favicon/apple-touch-icon.png -------------------------------------------------------------------------------- /docs/reference/figures/refpptx_nmfs.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/reference/figures/refpptx_nmfs.JPG -------------------------------------------------------------------------------- /docs/man/figures/folder_output_post_run.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/man/figures/folder_output_post_run.JPG -------------------------------------------------------------------------------- /docs/man/figures/refdoc_noaa_tech_memo.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/man/figures/refdoc_noaa_tech_memo.JPG -------------------------------------------------------------------------------- /inst/img/NOAA_Fisheries_logo_vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/img/NOAA_Fisheries_logo_vertical.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/pkgdown/favicon/apple-touch-icon-60x60.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/pkgdown/favicon/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /docs/5624caeb15464c07518bb1f2b4f9de1f.ico.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/5624caeb15464c07518bb1f2b4f9de1f.ico.zip -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/pkgdown/favicon/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/pkgdown/favicon/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/pkgdown/favicon/apple-touch-icon-180x180.png -------------------------------------------------------------------------------- /docs/reference/figures/refdoc_noaa_tech_memo.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/reference/figures/refdoc_noaa_tech_memo.JPG -------------------------------------------------------------------------------- /docs/reference/figures/folder_output_post_run.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/reference/figures/folder_output_post_run.JPG -------------------------------------------------------------------------------- /inst/rmd/refdoc_fisheries_economics_of_the_us.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/rmd/refdoc_fisheries_economics_of_the_us.docx -------------------------------------------------------------------------------- /inst/icons/5624caeb15464c07518bb1f2b4f9de1f.ico.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/inst/icons/5624caeb15464c07518bb1f2b4f9de1f.ico.zip -------------------------------------------------------------------------------- /man/figures/folder_architecture_post_buildReport.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/man/figures/folder_architecture_post_buildReport.JPG -------------------------------------------------------------------------------- /man/figures/refdoc_fisheries_economics_of_the_us.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/man/figures/refdoc_fisheries_economics_of_the_us.JPG -------------------------------------------------------------------------------- /presentations/2021-06-05NMFSReports-RCascadiaConf.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/presentations/2021-06-05NMFSReports-RCascadiaConf.pdf -------------------------------------------------------------------------------- /docs/man/figures/folder_architecture_post_buildReport.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/man/figures/folder_architecture_post_buildReport.JPG -------------------------------------------------------------------------------- /docs/man/figures/refdoc_fisheries_economics_of_the_us.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/man/figures/refdoc_fisheries_economics_of_the_us.JPG -------------------------------------------------------------------------------- /docs/reference/figures/folder_architecture_post_buildReport.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/reference/figures/folder_architecture_post_buildReport.JPG -------------------------------------------------------------------------------- /docs/reference/figures/refdoc_fisheries_economics_of_the_us.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/reference/figures/refdoc_fisheries_economics_of_the_us.JPG -------------------------------------------------------------------------------- /docs/articles/C_functions-to-help-write-report_files/figure-html/G1c-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/articles/C_functions-to-help-write-report_files/figure-html/G1c-1.png -------------------------------------------------------------------------------- /docs/articles/C_functions-to-help-write-report_files/figure-html/G2c-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/articles/C_functions-to-help-write-report_files/figure-html/G2c-1.png -------------------------------------------------------------------------------- /docs/articles/C_functions-to-help-write-report_files/figure-html/unnamed-chunk-18-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/articles/C_functions-to-help-write-report_files/figure-html/unnamed-chunk-18-1.png -------------------------------------------------------------------------------- /docs/articles/C_functions-to-help-write-report_files/figure-html/unnamed-chunk-20-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/articles/C_functions-to-help-write-report_files/figure-html/unnamed-chunk-20-1.png -------------------------------------------------------------------------------- /docs/articles/C_functions-to-help-write-report_files/figure-html/unnamed-chunk-3-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/articles/C_functions-to-help-write-report_files/figure-html/unnamed-chunk-3-1.png -------------------------------------------------------------------------------- /docs/articles/C_functions-to-help-write-report_files/figure-html/unnamed-chunk-5-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/articles/C_functions-to-help-write-report_files/figure-html/unnamed-chunk-5-1.png -------------------------------------------------------------------------------- /docs/articles/C_functions-to-help-write-report_files/figure-html/unnamed-chunk-7-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/articles/C_functions-to-help-write-report_files/figure-html/unnamed-chunk-7-1.png -------------------------------------------------------------------------------- /docs/articles/C_functions-to-help-write-report_files/figure-html/unnamed-chunk-9-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmilyMarkowitz-NOAA/NMFSReports/HEAD/docs/articles/C_functions-to-help-write-report_files/figure-html/unnamed-chunk-9-1.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .Rdata 4 | .httr-oauth 5 | .DS_Store 6 | 7 | inst/doc 8 | Meta 9 | 10 | .txt 11 | .zip 12 | vignettes/*.txt 13 | vignettes/*.zip 14 | /Meta/ 15 | 16 | /doc/ 17 | docs 18 | /documentation/ 19 | -------------------------------------------------------------------------------- /inst/rmd/1_data.R: -------------------------------------------------------------------------------- 1 | #' --- 2 | #' title: # INSERT_REPORT_TITLE 3 | #' author: # INSERT_AUTHOR 4 | #' purpose: Wrangle data 5 | #' start date: # YYYY-MM-DD 6 | #' date modified: # YYYY-MM-DD # CHANGE 7 | #' Notes: # CHANGE 8 | #' --- 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /inst/rmd/1_blank.R: -------------------------------------------------------------------------------- 1 | #' --- 2 | #' title: # INSERT_REPORT_TITLE 3 | #' author: # INSERT_AUTHOR 4 | #' purpose: # CHANGE 5 | #' start date: # YYYY-MM-DD 6 | #' date modified: # YYYY-MM-DD # CHANGE 7 | #' Notes: # CHANGE 8 | #' --- 9 | 10 | -------------------------------------------------------------------------------- /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^NMFSReports\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^LICENSE\.md$ 4 | 5 | ^notes\.R 6 | ^\./pkgdown/_pkgdown\.yml$ 7 | ^pkgdown$ 8 | ^\.github$ 9 | ^Meta$ 10 | 11 | ^\.txt$ 12 | ^\.zip$ 13 | ^\./vignettes/*\.txt$ 14 | ^\./vignettes/*\.zip$ 15 | 16 | ^doc$ 17 | ^docs$ 18 | ^documentation$ 19 | -------------------------------------------------------------------------------- /inst/icons/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | #ffffff -------------------------------------------------------------------------------- /inst/rmd/_TableFigureHeader.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "" 3 | author: "" 4 | date: "" 5 | output: 6 | word_document: 7 | df_print: kable 8 | reference_docx: word-styles-reference.docx 9 | --- 10 | 11 | ```{r, echo=FALSE, warning=FALSE} 12 | knitr::opts_chunk$set(echo=T) 13 | ``` 14 | 15 | ```{r, echo = FALSE, warning=FALSE} 16 | 17 | ``` 18 | 19 | #### `r Title0` 20 | 21 | -------------------------------------------------------------------------------- /inst/rmd/header.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | link-citations: true 3 | reference-section-title: References 4 | fig_caption: false 5 | # keywords: 6 | # - one 7 | # - two 8 | # knit: ( 9 | # function(inputFile, encoding) { 10 | # markdown::render( 11 | # input = inputFile, 12 | # encoding = encoding, 13 | # output_file = "rmd_output.docx" 14 | # ); doconv::docx2pdf("rmd_output.docx") 15 | # } 16 | # ) 17 | --- 18 | -------------------------------------------------------------------------------- /man/create_metadata.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NMFSReports.R 3 | \name{create_metadata} 4 | \alias{create_metadata} 5 | \title{Record Metadata} 6 | \usage{ 7 | create_metadata(dir_out = ".", title = "My Project") 8 | } 9 | \arguments{ 10 | \item{dir_out}{Path file will be saved to.} 11 | 12 | \item{title}{Title of file.} 13 | } 14 | \description{ 15 | Record Metadata 16 | } 17 | \keyword{metadata} 18 | -------------------------------------------------------------------------------- /inst/rmd/0_blank.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: 3 | word_document: 4 | pandoc_args: ["--metadata-file=header.yaml"] 5 | reference_docx: styles_reference.docx 6 | df_print: kable 7 | csl: "../cite/citestyle.csl" 8 | bibliography: "../cite/bibliography.bib" 9 | --- 10 | 11 | ```{r setup, include=FALSE} 12 | knitr::opts_chunk$set(echo = FALSE, warning = FALSE, error = FALSE, message = FALSE) 13 | ``` 14 | 15 | # SECTION_TITLE 16 | 17 | ```{r} 18 | 19 | ``` 20 | 21 | -------------------------------------------------------------------------------- /docs/pkgdown.yml: -------------------------------------------------------------------------------- 1 | pandoc: 2.17.1.1 2 | pkgdown: 2.0.5 3 | pkgdown_sha: ~ 4 | articles: 5 | A_use-buildReport: A_use-buildReport.html 6 | B_run-script-demo: B_run-script-demo.html 7 | C_functions-to-help-write-report: C_functions-to-help-write-report.html 8 | E_thispkgwasbuiltusing: E_thispkgwasbuiltusing.html 9 | last_built: 2022-07-03T08:11Z 10 | urls: 11 | reference: https://emilymarkowitz-noaa.github.io/NMFSReports/reference 12 | article: https://emilymarkowitz-noaa.github.io/NMFSReports/articles 13 | 14 | -------------------------------------------------------------------------------- /NMFSReports.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: No 4 | SaveWorkspace: No 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: knitr 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | LineEndingConversion: Posix 18 | 19 | BuildType: Package 20 | PackageUseDevtools: Yes 21 | PackageInstallArgs: --no-multiarch --with-keep.source 22 | PackageRoxygenize: rd,collate,namespace 23 | -------------------------------------------------------------------------------- /man/stndth.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NMFSReports.R 3 | \name{stndth} 4 | \alias{stndth} 5 | \title{Find the 'st, 'nd, or 'th of a value} 6 | \usage{ 7 | stndth(x) 8 | } 9 | \arguments{ 10 | \item{x}{a value you want the 'st, 'nd, or 'th of} 11 | } 12 | \value{ 13 | a character string of the appropriate 'st, 'nd, or 'th 14 | } 15 | \description{ 16 | Find the 'st, 'nd, or 'th of a value 17 | } 18 | \examples{ 19 | stndth(3) 20 | stndth(11) 21 | stndth(112) 22 | stndth(x = c(1120, 12)) 23 | } 24 | -------------------------------------------------------------------------------- /docs/articles/A_use-buildReport_files/header-attrs-2.8/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /docs/articles/B_run-script-demo_files/header-attrs-2.8/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /docs/articles/D_googledrive_files/header-attrs-2.10/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /docs/articles/D_googledrive_files/header-attrs-2.8/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /docs/articles/A_use-buildReport_files/header-attrs-2.10/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /docs/articles/B_run-script-demo_files/header-attrs-2.10/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /man/auto_counter.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NMFSReports.R 3 | \name{auto_counter} 4 | \alias{auto_counter} 5 | \title{Add a counter number.} 6 | \usage{ 7 | auto_counter(counter0) 8 | } 9 | \arguments{ 10 | \item{counter0}{The value it was to be added 1 to} 11 | } 12 | \value{ 13 | The number entered + 1, in the "0..X" format. All values will take on the number of 0s of the longest charcter value. 14 | } 15 | \description{ 16 | Add a counter number, 1, 1+1=2, 2+1=3. 17 | } 18 | \examples{ 19 | auto_counter(1) 20 | } 21 | \keyword{Data} 22 | \keyword{Management} 23 | -------------------------------------------------------------------------------- /docs/articles/E_thispkgwasbuiltusing_files/header-attrs-2.10/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /docs/articles/C_functions-to-help-write-report_files/header-attrs-2.8/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /docs/articles/C_functions-to-help-write-report_files/header-attrs-2.10/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /man/df2js.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NMFSReports.R 3 | \name{df2js} 4 | \alias{df2js} 5 | \title{Convert dataframe to javascript} 6 | \usage{ 7 | df2js(dat) 8 | } 9 | \arguments{ 10 | \item{dat}{The data frame you want to add the footnote to.} 11 | } 12 | \description{ 13 | Convert dataframe to javascript matrix. 14 | } 15 | \examples{ 16 | dat <- cbind.data.frame(matrix(LETTERS[1:8], nrow = 4), 17 | matrix(1:8, nrow = 4)) 18 | df2js(dat = dat) 19 | } 20 | \keyword{data.frame,} 21 | \keyword{footnote} 22 | \keyword{footnotes,} 23 | \keyword{javascript,} 24 | -------------------------------------------------------------------------------- /man/TitleCase.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NMFSReports.R 3 | \name{TitleCase} 4 | \alias{TitleCase} 5 | \title{Make a String Title Case} 6 | \usage{ 7 | TitleCase(str = "", add_dont_cap = "") 8 | } 9 | \arguments{ 10 | \item{str}{A string that you want to be in title case} 11 | 12 | \item{add_dont_cap}{A vector of strings that the user does not want capitalized} 13 | } 14 | \description{ 15 | Make a String Title Case (making and, the, an, etc. lower case) 16 | } 17 | \examples{ 18 | TitleCase("HelLo WoRLD OR good-bye?") 19 | } 20 | \keyword{Case,} 21 | \keyword{Title,} 22 | \keyword{strings} 23 | \keyword{word} 24 | -------------------------------------------------------------------------------- /man/numbers2words.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NMFSReports.R 3 | \name{numbers2words} 4 | \alias{numbers2words} 5 | \title{Convert number to text string.} 6 | \usage{ 7 | numbers2words(x) 8 | } 9 | \arguments{ 10 | \item{x}{The numbers that need to be converted to string.} 11 | } 12 | \description{ 13 | Function by John Fox found here: http://tolstoy.newcastle.edu.au/R/help/05/04/2715.html and https://github.com/ateucher/useful_code/blob/master/R/numbers2words.r 14 | } 15 | \examples{ 16 | numbers2words(x = 1890) 17 | numbers2words(x = 3) 18 | numbers2words(x = 1800090) 19 | } 20 | \keyword{Text} 21 | \keyword{editing} 22 | -------------------------------------------------------------------------------- /man/xunitspct.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NMFSReports.R 3 | \name{xunitspct} 4 | \alias{xunitspct} 5 | \title{Determine the appropriate unit for a percent value.} 6 | \usage{ 7 | xunitspct(value, sign = TRUE) 8 | } 9 | \arguments{ 10 | \item{value}{A numeric.} 11 | 12 | \item{sign}{Include percent sign. Default = T.} 13 | } 14 | \description{ 15 | Determine the appropriate unit for a percent value (e.g., 1000000 = '1 Million'. 16 | } 17 | \examples{ 18 | xunitspct(value = 8.4) 19 | xunitspct(value = -8.4, sign = TRUE) 20 | xunitspct(value = -8.4, sign = FALSE) 21 | } 22 | \keyword{Modify} 23 | \keyword{number,} 24 | \keyword{units} 25 | -------------------------------------------------------------------------------- /doc/E_thispkgwasbuiltusing.R: -------------------------------------------------------------------------------- 1 | ## ---- include = FALSE--------------------------------------------------------- 2 | knitr::opts_chunk$set( 3 | message = FALSE, echo = TRUE, warning = FALSE, 4 | comment = FALSE, collapse = TRUE, 5 | comment = "#>" 6 | ) 7 | options(rmarkdown.html_vignette.check_title = FALSE) 8 | 9 | ## ----setup-------------------------------------------------------------------- 10 | library(NMFSReports) 11 | 12 | ## ----------------------------------------------------------------------------- 13 | R.version 14 | 15 | ## ----------------------------------------------------------------------------- 16 | str(allPackage <- installed.packages(.Library, priority = "high")) 17 | 18 | allPackage [, c(1,3:5)] 19 | 20 | -------------------------------------------------------------------------------- /inst/rmd/1_dataDL.R: -------------------------------------------------------------------------------- 1 | #' --- 2 | #' title: # INSERT_REPORT_TITLE 3 | #' author: # INSERT_AUTHOR 4 | #' purpose: Download data 5 | #' start date: # YYYY-MM-DD 6 | #' date modified: # YYYY-MM-DD # CHANGE 7 | #' Notes: # CHANGE 8 | #' --- 9 | 10 | # Example Data 11 | 12 | # https://www.fisheries.noaa.gov/alaska/commercial-fishing/alaska-groundfish-bottom-trawl-survey-data 13 | 14 | # Download EBS 15 | # download.file(url = "https://www.afsc.noaa.gov/RACE/groundfish/survey_data/downloads/ebs2017_2018.zip", 16 | # destfile=paste0("./data/ebs2017_2018.zip") ) 17 | # 18 | # 19 | # zip::unzip(zipfile = paste0("./data/ebs2017_2018.zip"), 20 | # overwrite = T, 21 | # exdir = paste0("./data/")) 22 | -------------------------------------------------------------------------------- /man/numbers2words_th.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NMFSReports.R 3 | \name{numbers2words_th} 4 | \alias{numbers2words_th} 5 | \title{Convert number to text string.} 6 | \usage{ 7 | numbers2words_th(x, type = "word") 8 | } 9 | \arguments{ 10 | \item{x}{The numbers that need to be converted to string.} 11 | 12 | \item{type}{How the numbers should be converted. Default = "word" (which produces "fifty-third"), but you can also select "val_th" (which produces "53rd").} 13 | } 14 | \description{ 15 | Convert number to text string to the 'st, 'nd, 'rd, or 'th. 16 | } 17 | \examples{ 18 | numbers2words_th(x = 3, type = "val_th") 19 | numbers2words_th(x = 3, type = "word") 20 | } 21 | \keyword{Text} 22 | \keyword{editing} 23 | -------------------------------------------------------------------------------- /docs/articles/C_functions-to-help-write-report_files/tabwid-1.0.0/tabwid.css: -------------------------------------------------------------------------------- 1 | .tabwid table{ 2 | border-spacing:0px !important; 3 | border-collapse:collapse; 4 | line-height:1; 5 | margin-left:auto; 6 | margin-right:auto; 7 | border-width: 0; 8 | display: table; 9 | margin-top: 1.275em; 10 | margin-bottom: 1.275em; 11 | border-color: transparent; 12 | } 13 | .tabwid_left table{ 14 | margin-left:0; 15 | } 16 | .tabwid_right table{ 17 | margin-right:0; 18 | } 19 | .tabwid td { 20 | padding: 0; 21 | } 22 | .tabwid a { 23 | text-decoration: none; 24 | } 25 | .tabwid thead { 26 | background-color: transparent; 27 | } 28 | .tabwid tfoot { 29 | background-color: transparent; 30 | } 31 | .tabwid table tr { 32 | background-color: transparent; 33 | } 34 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(TitleCase) 4 | export(add_table_footnotes) 5 | export(auto_counter) 6 | export(buildReport) 7 | export(create_metadata) 8 | export(crossref) 9 | export(df2js) 10 | export(format_cells) 11 | export(googledrive_txt_dl) 12 | export(is_something_in_this_matrix) 13 | export(mod_number) 14 | export(numbers0) 15 | export(numbers2words) 16 | export(numbers2words_th) 17 | export(pchange) 18 | export(range_text) 19 | export(save_equations) 20 | export(save_figures) 21 | export(save_tables) 22 | export(stndth) 23 | export(text_list) 24 | export(theme_flextable_nmfstm) 25 | export(tolower2) 26 | export(xunits) 27 | export(xunitspct) 28 | importFrom(magrittr,"%>%") 29 | importFrom(officer,fp_border) 30 | importFrom(officer,fp_par) 31 | -------------------------------------------------------------------------------- /docs/link.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /man/url_exists.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NMFSReports.R 3 | \name{url_exists} 4 | \alias{url_exists} 5 | \title{Test if a URL works/exists} 6 | \usage{ 7 | url_exists(x, non_2xx_return_value = FALSE, quiet = FALSE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{a single URL} 11 | 12 | \item{non_2xx_return_value}{what to do if the site exists but the 13 | HTTP status code is not in the \verb{2xx} range. Default is to return \code{FALSE}.} 14 | 15 | \item{quiet}{if not \code{FALSE}, then every time the \code{non_2xx_return_value} condition 16 | arises a warning message will be displayed. Default is \code{FALSE}.} 17 | 18 | \item{...}{other params (\code{timeout()} would be a good one) passed directly 19 | to \code{httr::HEAD()} and/or \code{httr::GET()}} 20 | } 21 | \description{ 22 | Test if a URL works/exists 23 | } 24 | -------------------------------------------------------------------------------- /man/tolower2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NMFSReports.R 3 | \name{tolower2} 4 | \alias{tolower2} 5 | \title{Make a string lower case except for stated (and common NOAA) proper nouns.} 6 | \usage{ 7 | tolower2(str0, capitalizefirst = FALSE, add_cap = "") 8 | } 9 | \arguments{ 10 | \item{str0}{The text string.} 11 | 12 | \item{capitalizefirst}{Default = FALSE} 13 | 14 | \item{add_cap}{A vector of strings that the user does not want capitalized} 15 | } 16 | \description{ 17 | Make a string lower case except for stated (and common NOAA) proper nouns. 18 | } 19 | \examples{ 20 | tolower2(str0 = "notice how there are built-in proper nouns are capitalized: 21 | alaska is not in the south atlantic.", 22 | capitalizefirst = TRUE, 23 | add_cap = "Proper nouns") 24 | } 25 | \keyword{Text} 26 | \keyword{editing} 27 | -------------------------------------------------------------------------------- /inst/rmd/0_endmatter.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: 3 | word_document: 4 | pandoc_args: ["--metadata-file=header.yaml"] 5 | reference_docx: styles_reference.docx 6 | csl: "../cite/citestyle.csl" 7 | bibliography: "../cite/bibliography_RPack.bib" 8 | nocite: '@*' 9 | --- 10 | 11 | ```{r setup, include=FALSE} 12 | knitr::opts_chunk$set(echo = FALSE, warning = FALSE, error = FALSE, message = FALSE) 13 | ``` 14 | 15 |
16 | 17 | 18 | ## Acknowlegements 19 | 20 | 21 | 22 | 23 |
24 | 25 | ## ORCID 26 | 27 | > First Last (ORCID#) 28 | 29 | 30 | 31 | \newpage 32 | 33 | 34 | ## Works Cited 35 | 36 |
37 | 38 | ### R Packages 39 | 40 |
41 | 42 |
43 | 44 | 45 | ### Works Cited 46 | 47 | 48 | -------------------------------------------------------------------------------- /inst/icons/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "App", 3 | "icons": [ 4 | { 5 | "src": "\/android-icon-36x36.png", 6 | "sizes": "36x36", 7 | "type": "image\/png", 8 | "density": "0.75" 9 | }, 10 | { 11 | "src": "\/android-icon-48x48.png", 12 | "sizes": "48x48", 13 | "type": "image\/png", 14 | "density": "1.0" 15 | }, 16 | { 17 | "src": "\/android-icon-72x72.png", 18 | "sizes": "72x72", 19 | "type": "image\/png", 20 | "density": "1.5" 21 | }, 22 | { 23 | "src": "\/android-icon-96x96.png", 24 | "sizes": "96x96", 25 | "type": "image\/png", 26 | "density": "2.0" 27 | }, 28 | { 29 | "src": "\/android-icon-144x144.png", 30 | "sizes": "144x144", 31 | "type": "image\/png", 32 | "density": "3.0" 33 | }, 34 | { 35 | "src": "\/android-icon-192x192.png", 36 | "sizes": "192x192", 37 | "type": "image\/png", 38 | "density": "4.0" 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /doc/E_thispkgwasbuiltusing.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "System and packages used to build NMFSReports" 3 | date: "`r format(Sys.Date(), format='%B %d %Y') `" 4 | output: rmarkdown::html_vignette 5 | vignette: > 6 | %\VignetteIndexEntry{E_thispkgwasbuiltusing} 7 | %\VignetteEngine{knitr::rmarkdown} 8 | %\VignetteEncoding{UTF-8} 9 | --- 10 | 11 | ```{r, include = FALSE} 12 | knitr::opts_chunk$set( 13 | message = FALSE, echo = TRUE, warning = FALSE, 14 | comment = FALSE, collapse = TRUE, 15 | comment = "#>" 16 | ) 17 | options(rmarkdown.html_vignette.check_title = FALSE) 18 | ``` 19 | 20 | ```{r setup} 21 | library(NMFSReports) 22 | ``` 23 | 24 | # This vignette does not contain any examples of using NMF Reports, specifically, but does record what packges and system is ws built on. See below: 25 | 26 | ```{r} 27 | R.version 28 | ``` 29 | 30 | 31 | ```{r} 32 | str(allPackage <- installed.packages(.Library, priority = "high")) 33 | 34 | allPackage [, c(1,3:5)] 35 | ``` 36 | 37 | -------------------------------------------------------------------------------- /vignettes/E_thispkgwasbuiltusing.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "System and packages used to build NMFSReports" 3 | date: "`r format(Sys.Date(), format='%B %d %Y') `" 4 | output: rmarkdown::html_vignette 5 | vignette: > 6 | %\VignetteIndexEntry{E_thispkgwasbuiltusing} 7 | %\VignetteEngine{knitr::rmarkdown} 8 | %\VignetteEncoding{UTF-8} 9 | --- 10 | 11 | ```{r, include = FALSE} 12 | knitr::opts_chunk$set( 13 | message = FALSE, echo = TRUE, warning = FALSE, 14 | comment = FALSE, collapse = TRUE, 15 | comment = "#>" 16 | ) 17 | options(rmarkdown.html_vignette.check_title = FALSE) 18 | ``` 19 | 20 | ```{r setup} 21 | library(NMFSReports) 22 | ``` 23 | 24 | # This vignette does not contain any examples of using NMF Reports, specifically, but does record what packges and system is ws built on. See below: 25 | 26 | ```{r} 27 | R.version 28 | ``` 29 | 30 | 31 | ```{r} 32 | str(allPackage <- installed.packages(.Library, priority = "high")) 33 | 34 | allPackage [, c(1,3:5)] 35 | ``` 36 | 37 | -------------------------------------------------------------------------------- /man/mod_number.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NMFSReports.R 3 | \name{mod_number} 4 | \alias{mod_number} 5 | \title{Modify numbers.} 6 | \usage{ 7 | mod_number(x, divideby = 1000, comma_seperator = TRUE, digits = 0) 8 | } 9 | \arguments{ 10 | \item{x}{A numeric.} 11 | 12 | \item{divideby}{The value you want all of your values divided by. Default = 1000.} 13 | 14 | \item{comma_seperator}{Do you want numbers to have commas in it ("1,000" (T) vs. "1000" (F). Default = TRUE.} 15 | 16 | \item{digits}{How many digits you would like your number to have. Default = 0.} 17 | } 18 | \description{ 19 | Modify numbers. 20 | } 21 | \examples{ 22 | x = data.frame(matrix(data = c(20000678660, 234567, 1, NA, 2345, 23), 23 | ncol = 2)) 24 | mod_number(x) 25 | mod_number(x, 26 | comma_seperator = FALSE) 27 | x = data.frame(matrix(data = c(200000, 234567, 1, NA, 2345, 23))) 28 | mod_number(x, 29 | divideby = 1, 30 | digits = 2) 31 | } 32 | \keyword{Modify} 33 | \keyword{number} 34 | -------------------------------------------------------------------------------- /man/pchange.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NMFSReports.R 3 | \name{pchange} 4 | \alias{pchange} 5 | \title{Calculate the percent change.} 6 | \usage{ 7 | pchange(start, end, ending = "", percent_first = TRUE, value_only = FALSE) 8 | } 9 | \arguments{ 10 | \item{start}{The value it started with.} 11 | 12 | \item{end}{The value it ended with.} 13 | 14 | \item{ending}{A text string. Default "".} 15 | 16 | \item{percent_first}{Options: T/F. Puts the percent first in the sentance.} 17 | 18 | \item{value_only}{Options: T/F. Will only provide the value, and no text. percent_first is over-ridden.} 19 | } 20 | \description{ 21 | Calculate the percent change. 22 | } 23 | \examples{ 24 | pchange(start = 8, end = 1) 25 | pchange(start = 3, end = 6, ending = " in fish landings", percent_first = TRUE) 26 | pchange(start = 3, end = 4, ending = " in fish landings", percent_first = FALSE) 27 | pchange(start = 3, end = 4, ending = " in fish landings", value_only = TRUE) 28 | } 29 | \keyword{Modify} 30 | \keyword{number} 31 | -------------------------------------------------------------------------------- /man/numbers0.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NMFSReports.R 3 | \name{numbers0} 4 | \alias{numbers0} 5 | \title{Make numbers the same length preceeded by 0s} 6 | \usage{ 7 | numbers0(x, number_places = NA) 8 | } 9 | \arguments{ 10 | \item{x}{a single or vector of integer values that need to be converted from something like 1 to "001"} 11 | 12 | \item{number_places}{default = NA. If equal to NA, the function will take use the longest length of a value provided in x (example 1). If equal to a number, it will make sure that every number is the same length of number_places (example 2) or larger (if a value of x has more places than number_places(example 3)).} 13 | } 14 | \value{ 15 | A string of the values in x preceeded by "0"s 16 | } 17 | \description{ 18 | Name nth item in order (001) 19 | } 20 | \examples{ 21 | # example 1 22 | numbers0(x = c(1,11,111)) 23 | # example 2 24 | numbers0(x = c(1,11,111), number_places = 4) 25 | # example 3 26 | numbers0(x = c(1,11,111), number_places = 2) 27 | } 28 | \keyword{Data} 29 | \keyword{Management} 30 | -------------------------------------------------------------------------------- /inst/rmd/0_coverpage.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: 3 | word_document: 4 | pandoc_args: ["--metadata-file=header.yaml"] 5 | reference_docx: styles_reference.docx 6 | --- 7 | 8 | ```{r setup, include=FALSE} 9 | knitr::opts_chunk$set(echo = FALSE, warning = FALSE, error = FALSE) 10 | ``` 11 | 12 | 13 | # `r report_title ` 14 | 15 | By 16 | 17 | `r report_authors ` 18 | 19 | 20 |
21 | 22 | `r report_office_location` 23 | 24 |
25 | 26 | 27 |
28 |
29 | 30 | ![](../img/DeptOfCommerce.jpg){width=25%} 31 | 32 | U.S. Department of Commerce 33 | 34 | National Oceanic and Atmospheric Administration 35 | 36 | National Marine Fisheries Service 37 | 38 |
39 |
40 | 41 | 42 | `r months(Sys.Date()) ` `r as.numeric(format(as.Date(Sys.Date(),'%Y-%m-%d'),'%Y')) ` 43 | 44 | **Recommended citation:** 45 | 46 | `r report_authors `. `r report_yr `. `r report_title ` NOAA Tech. Memo. NMFS-[`r report_office`]-`r report_num`, 47 | 48 |
49 |
50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | > ## p. 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /man/is_something_in_this_matrix.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NMFSReports.R 3 | \name{is_something_in_this_matrix} 4 | \alias{is_something_in_this_matrix} 5 | \title{Is something in a matrix? Let's check!} 6 | \usage{ 7 | is_something_in_this_matrix(x, search_for) 8 | } 9 | \arguments{ 10 | \item{x}{The matrix that needs to be searched.} 11 | 12 | \item{search_for}{Items to be searched for in matrix x.} 13 | } 14 | \value{ 15 | TRUE or FALSE 16 | } 17 | \description{ 18 | This function searches to see if item 'search_for' is within the matrix 'x' and returns a respective TRUE (T) and FALSE (F). This can be useful for adding footnotes, adding conditional text to your document, and much more! 19 | } 20 | \examples{ 21 | x = data.frame(matrix(1:9, nrow = 3, ncol = 3)) 22 | x 23 | is_something_in_this_matrix(x, 24 | search_for = 9) 25 | x = data.frame(matrix(LETTERS[1:9], nrow = 3, ncol = 3)) 26 | is_something_in_this_matrix(x, 27 | search_for = "J") 28 | } 29 | \keyword{footnote,} 30 | \keyword{footnotes} 31 | \keyword{matrix,} 32 | \keyword{search,} 33 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (c) 2021 Emily Markowitz 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /man/text_list.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NMFSReports.R 3 | \name{text_list} 4 | \alias{text_list} 5 | \title{Takes a string of words and combines them into a sentance that lists them.} 6 | \usage{ 7 | text_list(x = "", oxford = TRUE, sep = ", ", sep_last = "and ") 8 | } 9 | \arguments{ 10 | \item{x}{Character strings you want in your string.} 11 | 12 | \item{oxford}{T/F: would you like to use an oxford comma? Default = TRUE} 13 | 14 | \item{sep}{string. default = ", " but "; " or " " might be what you need!} 15 | 16 | \item{sep_last}{string. default = " and " but " & " or " , " might be what you need!} 17 | } 18 | \description{ 19 | This function alows you to take a string of words and combine them into a sentance list. For example, 'apples', 'oranges', 'pears' would become 'apples, oranges, and pears'. This function uses oxford commas. 20 | } 21 | \examples{ 22 | text_list(c(1,2,"hello",4,"world",6)) 23 | text_list(c(1,"world")) 24 | text_list(c(1,2,"hello",4,"world",6), oxford = FALSE) 25 | paste0("here is a list of things: ", 26 | text_list(paste0("list", 1:5), sep = " ", sep_last = "")) 27 | } 28 | \keyword{strings} 29 | -------------------------------------------------------------------------------- /man/xunits.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NMFSReports.R 3 | \name{xunits} 4 | \alias{xunits} 5 | \title{Determine the appropriate unit for a value.} 6 | \usage{ 7 | xunits(value, val_under_x_words = 10, words = TRUE) 8 | } 9 | \arguments{ 10 | \item{value}{A numeric value.} 11 | 12 | \item{val_under_x_words}{a numeric that defines what values should be words as opposed to characters in a text. For example, many styles prefer that all values from 0 to 10 are spelled out in words, so you would set this parameter to 10 (which is the default). Set this parameter to NULL for nothing to to be spelled out.} 13 | 14 | \item{words}{T/F. Default = TRUE. If TRUE, "1000000" would become "1 Million" and if FALSE would become "1,000,000".} 15 | } 16 | \description{ 17 | Determine the appropriate unit for a value (e.g., 1000000 = '1 Million'. 18 | } 19 | \examples{ 20 | xunits(value = NA) 21 | xunits(value = c(0, 1)) 22 | xunits(value = c(0, 1), val_under_x_words = 0) 23 | xunits(value = 12) 24 | xunits(value = c(12345, 123456, 1234567)) 25 | xunits(value = 123456789) 26 | xunits(value = 123456789, words = FALSE) 27 | } 28 | \keyword{Modify} 29 | \keyword{number,} 30 | \keyword{units} 31 | -------------------------------------------------------------------------------- /inst/rmd/0_presentation.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "`r report_title`" 3 | author: "`r report_authors`" 4 | csl: "../cite/citestyle.csl" 5 | bibliography: "../cite/bibliography.bib" 6 | date: "`r format(Sys.time(), '%B %d, %Y')`" 7 | output: 8 | powerpoint_presentation: 9 | reference_doc: styles_reference.pptx 10 | df_print: kable 11 | --- 12 | 13 | ```{r setup, include=FALSE} 14 | knitr::opts_chunk$set( 15 | echo = FALSE, 16 | message = FALSE, 17 | warning = FALSE, 18 | message = FALSE, 19 | # dev = "svg", 20 | fig.width = 12, 21 | fig.height = 12 22 | # fig.retina = 3 23 | ) 24 | ``` 25 | 26 | # Example of how to use this R Markdown document 27 | 28 | ```{r ChunkName_NameMeAnythingAsLongAsItIsUnique} 29 | #Chunks are were we can write code for something later in the code. 30 | 31 | 32 | ``` 33 | 34 | 35 | 36 | # `r list_figures[[1]]$header ` 37 | 38 | ```{r} 39 | print(list_figures[[1]]$figure) 40 | ``` 41 | 42 | # `r list_tables[[1]]$header ` 43 | 44 | `r list_tables[[1]]$print ` 45 | 46 | 47 | # Slide 3 48 | 49 | :::::: {.columns} 50 | ::: {.column} 51 | - Text 1. 52 | - Text 2. 53 | ::: 54 | 55 | ::: {.column} 56 | ![](../img/DeptOfCommerce.jpg){width=25%} 57 | ::: 58 | :::::: 59 | 60 | -------------------------------------------------------------------------------- /man/format_cells.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NMFSReports.R 3 | \name{format_cells} 4 | \alias{format_cells} 5 | \title{Add bold, italics, strikethrough in formating to table.} 6 | \usage{ 7 | format_cells(dat, rows, cols, fonttype) 8 | } 9 | \arguments{ 10 | \item{dat}{A data.frame.} 11 | 12 | \item{rows}{The rows you want to apply formatting to.} 13 | 14 | \item{cols}{The columns you want to apply formatting to.} 15 | 16 | \item{fonttype}{fonttype = c("italics", "bold", "strikethrough").} 17 | } 18 | \description{ 19 | https://stackoverflow.com/questions/28166168/how-to-change-fontface-bold-italics-for-a-cell-in-a-kable-table-in-rmarkdown 20 | } 21 | \examples{ 22 | df <- data.frame(char = c('a','b','c'), 23 | num = c(1,2,3)) 24 | 25 | format_cells(df, 1, 1, "italics") 26 | format_cells(df, 2, 2, "bold") 27 | format_cells(df, 3, 1:2, "strikethrough") 28 | 29 | library(knitr) 30 | library(kableExtra) 31 | library(magrittr) 32 | df \%>\% 33 | format_cells(1, 1, "italics") \%>\% 34 | format_cells(2, 2, "bold") \%>\% 35 | format_cells(3, 1:2, "strikethrough") \%>\% 36 | knitr::kable() 37 | } 38 | \keyword{Modify} 39 | \keyword{number,} 40 | \keyword{units} 41 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: NMFSReports 2 | Title: Easily write NOAA reports and Tech Memos in R Markdown! 3 | Version: 0.0.1.3 4 | Authors@R: 5 | person(given = "Emily", 6 | family = "Markowitz", 7 | role = c("aut", "cre"), 8 | email = "Emily.Markowitz@noaa.gov", 9 | comment = c(ORCID = "0000-0001-5757-4230")) 10 | Description: Easily write NOAA reports and Tech Memos in R Markdown with these easy funcitons and structured workflow! 11 | Date: `Sys.Date()` 12 | URL: https://EmilyMarkowitz-NOAA.github.io/NMFSReports/, https://github.com/EmilyMarkowitz-NOAA/NMFSReports 13 | BugReports: https://github.com/EmilyMarkowitz-NOAA/NMFSReports/issues/ 14 | License: MIT + file LICENSE 15 | Encoding: UTF-8 16 | LazyData: true 17 | Roxygen: list(markdown = TRUE) 18 | RoxygenNote: 7.2.0 19 | Imports: 20 | dplyr, 21 | officer, 22 | ggplot2, 23 | magrittr, 24 | extrafont, 25 | stringr, 26 | jsonlite, 27 | knitcitations, 28 | XML, 29 | googledrive, 30 | flextable, 31 | utils, 32 | httr 33 | Suggests: 34 | testthat (>= 3.0.0), 35 | rmarkdown, 36 | cowplot, 37 | png, 38 | magick, 39 | kableExtra, 40 | knitr 41 | Config/testthat/edition: 3 42 | Depends: 43 | R (>= 2.10) 44 | VignetteBuilder: knitr 45 | -------------------------------------------------------------------------------- /doc/D_googledrive.R: -------------------------------------------------------------------------------- 1 | ## ---- include = FALSE--------------------------------------------------------- 2 | knitr::opts_chunk$set( 3 | message = FALSE, echo = TRUE, warning = FALSE, 4 | comment = FALSE, collapse = TRUE, 5 | comment = "#>" 6 | ) 7 | options(rmarkdown.html_vignette.check_title = FALSE) 8 | 9 | ## ----setup-------------------------------------------------------------------- 10 | library(NMFSReports) 11 | library(googledrive) 12 | library(XML) 13 | 14 | ## ---- eval = FALSE------------------------------------------------------------ 15 | # library("googledrive") 16 | # 17 | # drive_deauth() 18 | # drive_auth() 19 | # 1 # Using the first token you have. 20 | # 21 | # googledrive::drive_download("test123123_spreadsheet", # Must be a unique name 22 | # type = "csv", 23 | # overwrite = TRUE, 24 | # path = "./test123123_spreadsheet") 25 | # 26 | # a<-readr::read_csv("test123123_spreadsheet.csv") 27 | # kable(a) 28 | 29 | ## ---- eval = FALSE------------------------------------------------------------ 30 | # txt <- googledrive_txt_dl(filename_gd = "test123123_doc", 31 | # filename_dl = "test123123_doc_downloaded", 32 | # path = "./", 33 | # verbose = FALSE) 34 | # txt 35 | 36 | -------------------------------------------------------------------------------- /man/googledrive_txt_dl.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NMFSReports.R 3 | \name{googledrive_txt_dl} 4 | \alias{googledrive_txt_dl} 5 | \title{Download text from google drive as plain text} 6 | \usage{ 7 | googledrive_txt_dl( 8 | filename_gd = NULL, 9 | filename_dl = "googledrive_dl_text", 10 | path = "./", 11 | verbose = TRUE 12 | ) 13 | } 14 | \arguments{ 15 | \item{filename_gd}{The file path or filename of the google doc from google drive.} 16 | 17 | \item{filename_dl}{The filename you want to download the google doc as. Default = "googledrive_dl_text".} 18 | 19 | \item{path}{The path you want to save this file to. Default = "./"} 20 | 21 | \item{verbose}{Logical, indicating whether to print informative messages (default TRUE).} 22 | } 23 | \value{ 24 | The plain text from the google doc. 25 | } 26 | \description{ 27 | Download text from google drive as plain text 28 | } 29 | \examples{ 30 | # not run: 31 | # googledrive::drive_auth() # Using the first token you have. 32 | # 1 33 | # 34 | # txt <- googledrive_txt_dl(filename_gd = "test123123_doc", 35 | # filename_dl = "test123123_dl", 36 | # verbose = FALSE) 37 | # txt 38 | # for good file keeping, I'll delete these 39 | file.remove('test123123_dl.txt', 'test123123_dl.zip') 40 | } 41 | -------------------------------------------------------------------------------- /man/range_text.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NMFSReports.R 3 | \name{range_text} 4 | \alias{range_text} 5 | \title{Find a range of numbers for text} 6 | \usage{ 7 | range_text(x, dash = "-", oxford = TRUE, sep = ", ", sep_last = "and ") 8 | } 9 | \arguments{ 10 | \item{x}{A numeric vector of any length. Any duplicates will be removed.} 11 | 12 | \item{dash}{A string that will go between consecutive values in the string output.} 13 | 14 | \item{oxford}{Default = TRUE. Will only be used if the vector x provided is not continuous. Inherited from NMFSReports::text_list().} 15 | 16 | \item{sep}{Default = ", ". Will only be used if the vector x provided is not continuous. Inherited from NMFSReports::text_list().} 17 | 18 | \item{sep_last}{Default = "and ". Will only be used if the vector x provided is not continuous. Inherited from NMFSReports::text_list().} 19 | } 20 | \value{ 21 | A string with the range of those values as might be included in a sentence ("1-3, 5, and 7-8"). 22 | } 23 | \description{ 24 | This function outputs the range of values (broken or continuous) as you would want to display it in text. 25 | } 26 | \examples{ 27 | # a typical example 28 | x <- c(2003:2005, 2007, 2010:2012) 29 | range_text(x) 30 | # example has duplicate values out of order and specifies for a different dash and no oxford comma 31 | x <- c(1,2,11,3,4,7,NA,8,3) 32 | range_text(x, dash = "--", oxford = FALSE) 33 | } 34 | -------------------------------------------------------------------------------- /inst/rmd/bib_example.bib: -------------------------------------------------------------------------------- 1 | @article{RN621, 2 | author = {Arrhenius, Svante}, 3 | title = {Über die Reaktionsgeschwindigkeit bei der Inversion von Rohrzucker durch Säuren}, 4 | journal = {Zeitschrift für physikalische Chemie}, 5 | volume = {4}, 6 | number = {1}, 7 | pages = {226-248}, 8 | ISSN = {2196-7156}, 9 | year = {1889}, 10 | type = {Journal Article} 11 | } 12 | 13 | @book{RN686, 14 | author = {Fry, Frederick Ernest Joseph}, 15 | title = {The Physiology of Fishes}, 16 | publisher = {Academic Press}, 17 | address = {London}, 18 | volume = {1}, 19 | series = {The Physiology of Fishes}, 20 | pages = {iii}, 21 | ISBN = {978-1-4832-2817-4}, 22 | DOI = {https://doi.org/10.1016/B978-1-4832-2817-4.50001-9}, 23 | url = {http://www.sciencedirect.com/science/article/pii/B9781483228174500019}, 24 | year = {1957}, 25 | type = {Book} 26 | } 27 | 28 | @inbook{RN465, 29 | author = {Fry, Frederick Ernest Joseph}, 30 | title = {The Effect of Environmental Factors on the Physiology of Fish}, 31 | booktitle = {Fish Physiology}, 32 | editor = {Hoar, W. S. and Randall, D. J.}, 33 | publisher = {Academic Press}, 34 | volume = {Volume 6}, 35 | pages = {1-98}, 36 | ISBN = {1546-5098}, 37 | DOI = {http://dx.doi.org/10.1016/S1546-5098(08)60146-6}, 38 | url = {http://www.sciencedirect.com/science/article/pii/S1546509808601466}, 39 | year = {1971}, 40 | type = {Book Section} 41 | } 42 | 43 | -------------------------------------------------------------------------------- /.github/workflows/pkgdown.yaml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: 4 | - main 5 | - master 6 | tags: 7 | -'*' 8 | 9 | name: pkgdown 10 | 11 | jobs: 12 | pkgdown: 13 | runs-on: macOS-latest 14 | env: 15 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 16 | steps: 17 | - uses: actions/checkout@v2 18 | 19 | - uses: r-lib/actions/setup-r@v1 20 | 21 | - uses: r-lib/actions/setup-pandoc@v1 22 | 23 | - name: Query dependencies 24 | run: | 25 | install.packages('remotes') 26 | saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) 27 | writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") 28 | shell: Rscript {0} 29 | 30 | - name: Restore R package cache 31 | uses: actions/cache@v2 32 | with: 33 | path: ${{ env.R_LIBS_USER }} 34 | key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} 35 | restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- 36 | 37 | - name: Install dependencies 38 | run: | 39 | remotes::install_deps(dependencies = TRUE) 40 | install.packages("pkgdown", type = "binary") 41 | shell: Rscript {0} 42 | 43 | - name: Install package 44 | run: R CMD INSTALL . 45 | 46 | - name: Deploy package 47 | run: | 48 | git config --local user.email "actions@github.com" 49 | git config --local user.name "GitHub Actions" 50 | Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)' 51 | -------------------------------------------------------------------------------- /inst/rmd/0_figtab.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: 3 | word_document: 4 | pandoc_args: ["--metadata-file=header.yaml"] 5 | reference_docx: styles_reference.docx 6 | df_print: kable 7 | csl: "../cite/citestyle.csl" 8 | bibliography: "../cite/bibliography.bib" 9 | --- 10 | 11 | 12 | ```{r setup, include=FALSE} 13 | knitr::opts_chunk$set(echo = FALSE, warning = FALSE, error = FALSE, message = FALSE) 14 | ``` 15 | 16 | # Example figures and tables 17 | 18 | ## fig_example 19 | 20 | ```{r fig_example} 21 | header <- "Example figure. " 22 | nickname <- "fig_example" 23 | width <- 6 24 | height <- 6 25 | 26 | figure <- ggplot2::ggplot(mapping = aes(x = x, y = y), 27 | data = data.frame(x = 1, y = 1)) + 28 | ggplot2::geom_point() 29 | 30 | # save figure 31 | res <- knitr::knit_child( 32 | text = knitr::knit_expand( 33 | file = system.file("rmd/_child_save_fig.Rmd", 34 | package = "NMFSReports")), 35 | quiet = TRUE 36 | ) 37 | 38 | list_figures[nickname][[1]]$res <- res <- paste0(" 39 | 40 | ",res," 41 | 42 | ") 43 | 44 | ``` 45 | 46 | ## tab_example 47 | 48 | ```{r tab_stratum_areas} 49 | header <- "Example table. " 50 | nickname <- "tab_example" 51 | 52 | table_raw <- data.frame(x = 1, y = 1) 53 | 54 | table_print <- flextable::flextable(table_raw) 55 | table_print <- NMFSReports::theme_flextable_nmfstm(table_print) 56 | 57 | # save table 58 | res <- knitr::knit_child( 59 | text = knitr::knit_expand( 60 | file = system.file("rmd/_child_save_tab.Rmd", package = "NMFSReports")), 61 | quiet = TRUE 62 | ) 63 | 64 | list_tables[nickname][[1]]$res <- res <- paste0(" 65 | 66 | ",res," 67 | 68 | ") 69 | 70 | ``` 71 | 72 | -------------------------------------------------------------------------------- /man/theme_flextable_nmfstm.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NMFSReports.R 3 | \name{theme_flextable_nmfstm} 4 | \alias{theme_flextable_nmfstm} 5 | \title{Apply vanilla theme} 6 | \usage{ 7 | theme_flextable_nmfstm( 8 | x, 9 | pgwidth = 6.5, 10 | row_lines = TRUE, 11 | body_size = 10, 12 | header_size = 10, 13 | font0 = "Times New Roman", 14 | spacing = 0.6, 15 | pad = 2 16 | ) 17 | } 18 | \arguments{ 19 | \item{x}{a flextable object} 20 | 21 | \item{pgwidth}{a numeric. The width in inches the table should be. Default = 6, which is ideal for A4 (8.5x11 in) portrait paper.} 22 | 23 | \item{row_lines}{T/F. If True, draws a line between each row.} 24 | 25 | \item{body_size}{Numeric. default = 11.} 26 | 27 | \item{header_size}{Numeric. default = 11.} 28 | 29 | \item{font0}{String. Default = "Times New Roman". Instead, you may want "Arial".} 30 | 31 | \item{spacing}{table spacing. default = 0.8.} 32 | 33 | \item{pad}{padding around each element. default = 0.1} 34 | } 35 | \description{ 36 | Apply theme vanilla to a flextable: 37 | The external horizontal lines of the different parts of 38 | the table (body, header, footer) are black 2 points thick, 39 | the external horizontal lines of the different parts 40 | are black 0.5 point thick. Header text is bold, 41 | text columns are left aligned, other columns are 42 | right aligned. 43 | } 44 | \section{Illustrations}{ 45 | 46 | 47 | \if{html}{\figure{fig_theme_vanilla_1.png}{options: width=60\%}} 48 | } 49 | 50 | \examples{ 51 | ft <- flextable::flextable(head(airquality)) 52 | ft <- NMFSReports::theme_flextable_nmfstm(ft) 53 | ft 54 | } 55 | \concept{functions related to themes} 56 | -------------------------------------------------------------------------------- /docs/bootstrap-toc.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) 3 | * Copyright 2015 Aidan Feldman 4 | * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ 5 | 6 | /* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ 7 | 8 | /* All levels of nav */ 9 | nav[data-toggle='toc'] .nav > li > a { 10 | display: block; 11 | padding: 4px 20px; 12 | font-size: 13px; 13 | font-weight: 500; 14 | color: #767676; 15 | } 16 | nav[data-toggle='toc'] .nav > li > a:hover, 17 | nav[data-toggle='toc'] .nav > li > a:focus { 18 | padding-left: 19px; 19 | color: #563d7c; 20 | text-decoration: none; 21 | background-color: transparent; 22 | border-left: 1px solid #563d7c; 23 | } 24 | nav[data-toggle='toc'] .nav > .active > a, 25 | nav[data-toggle='toc'] .nav > .active:hover > a, 26 | nav[data-toggle='toc'] .nav > .active:focus > a { 27 | padding-left: 18px; 28 | font-weight: bold; 29 | color: #563d7c; 30 | background-color: transparent; 31 | border-left: 2px solid #563d7c; 32 | } 33 | 34 | /* Nav: second level (shown on .active) */ 35 | nav[data-toggle='toc'] .nav .nav { 36 | display: none; /* Hide by default, but at >768px, show it */ 37 | padding-bottom: 10px; 38 | } 39 | nav[data-toggle='toc'] .nav .nav > li > a { 40 | padding-top: 1px; 41 | padding-bottom: 1px; 42 | padding-left: 30px; 43 | font-size: 12px; 44 | font-weight: normal; 45 | } 46 | nav[data-toggle='toc'] .nav .nav > li > a:hover, 47 | nav[data-toggle='toc'] .nav .nav > li > a:focus { 48 | padding-left: 29px; 49 | } 50 | nav[data-toggle='toc'] .nav .nav > .active > a, 51 | nav[data-toggle='toc'] .nav .nav > .active:hover > a, 52 | nav[data-toggle='toc'] .nav .nav > .active:focus > a { 53 | padding-left: 28px; 54 | font-weight: 500; 55 | } 56 | 57 | /* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ 58 | nav[data-toggle='toc'] .nav > .active > ul { 59 | display: block; 60 | } 61 | -------------------------------------------------------------------------------- /doc/D_googledrive.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Use {googledrive} to access documents from Google Drive made collaboratively with coworkers" 3 | date: "`r format(Sys.Date(), format='%B %d %Y') `" 4 | output: rmarkdown::html_vignette 5 | vignette: > 6 | %\VignetteIndexEntry{D_googledrive} 7 | %\VignetteEngine{knitr::rmarkdown} 8 | %\VignetteEncoding{UTF-8} 9 | --- 10 | 11 | ```{r, include = FALSE} 12 | knitr::opts_chunk$set( 13 | message = FALSE, echo = TRUE, warning = FALSE, 14 | comment = FALSE, collapse = TRUE, 15 | comment = "#>" 16 | ) 17 | options(rmarkdown.html_vignette.check_title = FALSE) 18 | ``` 19 | 20 | ```{r setup} 21 | library(NMFSReports) 22 | library(googledrive) 23 | library(XML) 24 | ``` 25 | 26 | 27 | A great resource for this is from [https://googledrive.tidyverse.org/](tidyverse). As long as you have access to a given spreadsheet or google doc file, you can easily and quickly download it using the the code below. You'll need to set up an API token, but it is just a few steps. 28 | 29 | Once accessed, the file will be saved to your directory and can be accessed for future use. 30 | 31 | # Google Spreadsheets 32 | 33 | [https://docs.google.com/spreadsheets/d/1U3LvtKOwSlZ_-6KFJDYLWUPGkASWxovETk7lihxHnUA/edit?usp=sharing](Here is a test document to play with.) 34 | 35 | ```{r, eval = FALSE} 36 | library("googledrive") 37 | 38 | drive_deauth() 39 | drive_auth() 40 | 1 # Using the first token you have. 41 | 42 | googledrive::drive_download("test123123_spreadsheet", # Must be a unique name 43 | type = "csv", 44 | overwrite = TRUE, 45 | path = "./test123123_spreadsheet") 46 | 47 | a<-readr::read_csv("test123123_spreadsheet.csv") 48 | kable(a) 49 | ``` 50 | 51 | # Google Docs 52 | 53 | [https://docs.google.com/document/d/1ebCqXHqPHYXfRN87qs8pTULA8_4W25yh4gTMSo5WB4E/edit?usp=sharing](Here is a test document to play with.) 54 | 55 | ```{r, eval = FALSE} 56 | txt <- googledrive_txt_dl(filename_gd = "test123123_doc", 57 | filename_dl = "test123123_doc_downloaded", 58 | path = "./", 59 | verbose = FALSE) 60 | txt 61 | ``` 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /inst/rmd/_child_save_eq.Rmd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ```{r, echo = FALSE} 5 | 6 | # Don't Edit This: 7 | subobj <- ifelse(exists("subobj"), subobj, FALSE) # create a subobj letter (1a) 8 | newobj <- ifelse(exists("newobj"), newobj, TRUE) # force a new object number (1b-> 2a and 1 -> 2) 9 | cnt_chapt_content<-NMFSReports::auto_counter(cnt_chapt_content) 10 | cnt_equations<-ifelse(newobj, cnt_equations+1, cnt_equations) 11 | 12 | if (subobj) { 13 | # if it contains letters 14 | if (newobj) { 15 | cnt_equations_sub <- letters[1] 16 | } else { 17 | cnt_equations_sub <- letters[which(letters == 18 | gsub("[^a-zA-Z]", "", list_equations[length(list_equations)][[1]]$number))+1] 19 | } 20 | } else { 21 | cnt_equations_sub <- "" 22 | } 23 | 24 | # Systematically save your plot with this function 25 | list_equations<-NMFSReports::save_equations( 26 | equation = equation, 27 | list_equations = list_equations, 28 | header = ifelse(exists("header", mode = "character"), header, ""), 29 | footnote = unlist(ifelse(exists(x = "footnote", mode = "character"), list(footnote), "")), 30 | alttext = ifelse(exists("alttext", mode = "character"), alttext, header), 31 | nickname = ifelse(exists("nickname", mode = "character"), nickname, filename0), 32 | cnt_chapt_content = ifelse(exists("cnt_chapt_content", mode = "character"), cnt_chapt_content, "001"), 33 | cnt = paste0(cnt_equations, cnt_equations_sub), 34 | ) 35 | ``` 36 | 37 | 38 | ```{r, echo = FALSE} 39 | 40 | # make sure you dont mistakenly name other files with these names 41 | remove_who <- c() 42 | remove_who0 <- c("equation", "header", "footnote", "subobj", "newobj", #"nickname", 43 | "alttext") 44 | for (i in 1:length(remove_who0)){ 45 | if(exists(remove_who0[i]) & !exists(remove_who0[i], mode = "function")){ 46 | remove_who <- c(remove_who, remove_who0[i]) 47 | } 48 | } 49 | remove(list = remove_who) 50 | 51 | ``` 52 | 53 | `r ifelse(indesign_flowin %in% TRUE, "", list_equations[[length(list_equations)]]$caption)` 54 | 55 | $$`r paste0(list_equations[[length(list_equations)]]$equation)`$$ 56 | 57 | `r if(indesign_flowin %in% FALSE & (list_equations[[length(list_equations)]]$alttext)!="") { paste0("*Alternative text: ", list_equations[[length(list_equations)]]$alttext, "*") } ` 58 | -------------------------------------------------------------------------------- /docs/docsearch.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | 3 | // register a handler to move the focus to the search bar 4 | // upon pressing shift + "/" (i.e. "?") 5 | $(document).on('keydown', function(e) { 6 | if (e.shiftKey && e.keyCode == 191) { 7 | e.preventDefault(); 8 | $("#search-input").focus(); 9 | } 10 | }); 11 | 12 | $(document).ready(function() { 13 | // do keyword highlighting 14 | /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ 15 | var mark = function() { 16 | 17 | var referrer = document.URL ; 18 | var paramKey = "q" ; 19 | 20 | if (referrer.indexOf("?") !== -1) { 21 | var qs = referrer.substr(referrer.indexOf('?') + 1); 22 | var qs_noanchor = qs.split('#')[0]; 23 | var qsa = qs_noanchor.split('&'); 24 | var keyword = ""; 25 | 26 | for (var i = 0; i < qsa.length; i++) { 27 | var currentParam = qsa[i].split('='); 28 | 29 | if (currentParam.length !== 2) { 30 | continue; 31 | } 32 | 33 | if (currentParam[0] == paramKey) { 34 | keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); 35 | } 36 | } 37 | 38 | if (keyword !== "") { 39 | $(".contents").unmark({ 40 | done: function() { 41 | $(".contents").mark(keyword); 42 | } 43 | }); 44 | } 45 | } 46 | }; 47 | 48 | mark(); 49 | }); 50 | }); 51 | 52 | /* Search term highlighting ------------------------------*/ 53 | 54 | function matchedWords(hit) { 55 | var words = []; 56 | 57 | var hierarchy = hit._highlightResult.hierarchy; 58 | // loop to fetch from lvl0, lvl1, etc. 59 | for (var idx in hierarchy) { 60 | words = words.concat(hierarchy[idx].matchedWords); 61 | } 62 | 63 | var content = hit._highlightResult.content; 64 | if (content) { 65 | words = words.concat(content.matchedWords); 66 | } 67 | 68 | // return unique words 69 | var words_uniq = [...new Set(words)]; 70 | return words_uniq; 71 | } 72 | 73 | function updateHitURL(hit) { 74 | 75 | var words = matchedWords(hit); 76 | var url = ""; 77 | 78 | if (hit.anchor) { 79 | url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; 80 | } else { 81 | url = hit.url + '?q=' + escape(words.join(" ")); 82 | } 83 | 84 | return url; 85 | } 86 | -------------------------------------------------------------------------------- /man/save_equations.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NMFSReports.R 3 | \name{save_equations} 4 | \alias{save_equations} 5 | \title{Systematically save your figures for your report} 6 | \usage{ 7 | save_equations( 8 | equation, 9 | list_equations, 10 | header = "", 11 | footnote = "", 12 | cnt_chapt_content = "001", 13 | cnt = 1, 14 | type = "Equation", 15 | alttext = "", 16 | nickname = "", 17 | message = FALSE 18 | ) 19 | } 20 | \arguments{ 21 | \item{equation}{The latex equation you would like to be saved.} 22 | 23 | \item{list_equations}{The list where all equations will be saved.} 24 | 25 | \item{header}{The name and title of the figure. Default = "".} 26 | 27 | \item{footnote}{Any footnote you want attached to this figure.} 28 | 29 | \item{cnt_chapt_content}{The order number that this exists in the chapter.} 30 | 31 | \item{cnt}{The figure number.} 32 | 33 | \item{type}{Default = "Equation", but can be anything that the element needs to be called (e.g., "Eq.", "Equ.") to fit in the phrase "Equation 1. This is my equation!".} 34 | 35 | \item{alttext}{String with what the alternative text is.} 36 | 37 | \item{nickname}{A unique name that can be used to identify the figure so it can be referenced later in the report.} 38 | 39 | \item{message}{TRUE/FALSE. Default = FALSE. If TRUE, it will print information about where your plot has been saved to.} 40 | } 41 | \value{ 42 | list_equations updated with the new equation and metadata. 43 | } 44 | \description{ 45 | Systematically save your figures for your report 46 | } 47 | \examples{ 48 | list_equations <- c() 49 | cnt_eq <- 0 50 | 51 | cnt_eq<-NMFSReports::auto_counter(cnt_eq) 52 | list_equations <-NMFSReports::save_equations( 53 | equation = "$$c^2 = b^2 + a^2$$", 54 | cnt = cnt_eq, 55 | list_equations = list_equations , 56 | nickname = "pythagorean", 57 | header = "Pythagorean theorem", 58 | footnote = "footnote about how cool the pythagorean theorem is.", 59 | alttext = "The Pythagoras theorem is a mathematical law.") 60 | 61 | cnt_eq<-NMFSReports::auto_counter(cnt_eq) 62 | list_equations <-NMFSReports::save_equations( 63 | equation = "$$F = G \frac{m_1 m_2}{d^2}$$", 64 | cnt = cnt_eq, 65 | list_equations = list_equations , 66 | nickname = "Newton", 67 | header = "Newton's Universal Law of Gravitation") 68 | 69 | names(list_equations ) 70 | list_equations 71 | } 72 | -------------------------------------------------------------------------------- /docs/extra.css: -------------------------------------------------------------------------------- 1 | 2 | @import url("https://nmfs-general-modeling-tools.github.io/nmfspalette/extra.css"); 3 | 4 | blockquote { 5 | font-size: 14px; 6 | margin-top: 8px; 7 | margin-bottom: 8px; 8 | margin-left: 8px; 9 | padding: 8px; 10 | padding-top: 4px; 11 | padding-bottom: 4px; 12 | } 13 | 14 | .fas fa-check fa-lg{ 15 | color:#bb00ff; 16 | } 17 | 18 | .mywrap_center{ 19 | display: flex; 20 | flex-direction:row; 21 | margin:auto; 22 | padding-left: 15px; 23 | } 24 | 25 | 26 | 27 | .badge{ 28 | width: 60px; 29 | max-height: 60px; 30 | border: none; 31 | background-repeat: no-repeat; 32 | background-size: cover; 33 | } 34 | 35 | #badge_internal_active{ 36 | background-image: url("badge_internal_active.png") 37 | } 38 | 39 | #badge_internal_inactive{ 40 | background-image: url("badge_internal_inactive.png") 41 | } 42 | 43 | #badge_external_active{ 44 | background-image: url("static/badge_external_active.png") 45 | } 46 | 47 | #badges{ 48 | background-image: url("static/badge_external_active.png") 49 | } 50 | 51 | 52 | #greybadge{ 53 | 54 | background-image: url("greybadge.png"); 55 | 56 | } 57 | #internal_inactive{ 58 | background-image: url("icons8-checkmark-24-internal-inactive.png"); 59 | background-repeat: none; 60 | background-size: cover; 61 | } 62 | #internal_active{ 63 | background-image: url("icons8-checkmark-24-internal-active.png"); 64 | background-repeat: none; 65 | background-size: cover; 66 | } 67 | #external_active{ 68 | background-image: url("static/icons8-checkmark-24-external-active.png"); 69 | background-repeat: none; 70 | background-size: cover; 71 | } 72 | 73 | .divider{ 74 | 75 | width: 100%; 76 | height: 8px; 77 | background-color:#0055A4; 78 | border: 0 none; 79 | margin-top: 20px; 80 | margin-bottom:20px; 81 | 82 | } 83 | 84 | .line{ 85 | border-right:1px solid black; 86 | } 87 | 88 | .mylink{padding: 5px; 89 | font-size: 14px;} 90 | 91 | .mylink:any-link { 92 | color:black; 93 | height: fit-content; 94 | } 95 | 96 | 97 | #email{ 98 | background-image: url("icons8-email-send-24.png"); 99 | /*background-repeat: none; 100 | background-size: cover; 101 | border:none; */ 102 | 103 | } 104 | 105 | 106 | .attribution{ 107 | display: flex; 108 | justify-content: flex-end; 109 | font-size: 10px; 110 | color:grey; 111 | } 112 | 113 | -------------------------------------------------------------------------------- /pkgdown/extra.css: -------------------------------------------------------------------------------- 1 | 2 | @import url("https://nmfs-general-modeling-tools.github.io/nmfspalette/extra.css"); 3 | 4 | blockquote { 5 | font-size: 14px; 6 | margin-top: 8px; 7 | margin-bottom: 8px; 8 | margin-left: 8px; 9 | padding: 8px; 10 | padding-top: 4px; 11 | padding-bottom: 4px; 12 | } 13 | 14 | .fas fa-check fa-lg{ 15 | color:#bb00ff; 16 | } 17 | 18 | .mywrap_center{ 19 | display: flex; 20 | flex-direction:row; 21 | margin:auto; 22 | padding-left: 15px; 23 | } 24 | 25 | 26 | 27 | .badge{ 28 | width: 60px; 29 | max-height: 60px; 30 | border: none; 31 | background-repeat: no-repeat; 32 | background-size: cover; 33 | } 34 | 35 | #badge_internal_active{ 36 | background-image: url("badge_internal_active.png") 37 | } 38 | 39 | #badge_internal_inactive{ 40 | background-image: url("badge_internal_inactive.png") 41 | } 42 | 43 | #badge_external_active{ 44 | background-image: url("static/badge_external_active.png") 45 | } 46 | 47 | #badges{ 48 | background-image: url("static/badge_external_active.png") 49 | } 50 | 51 | 52 | #greybadge{ 53 | 54 | background-image: url("greybadge.png"); 55 | 56 | } 57 | #internal_inactive{ 58 | background-image: url("icons8-checkmark-24-internal-inactive.png"); 59 | background-repeat: none; 60 | background-size: cover; 61 | } 62 | #internal_active{ 63 | background-image: url("icons8-checkmark-24-internal-active.png"); 64 | background-repeat: none; 65 | background-size: cover; 66 | } 67 | #external_active{ 68 | background-image: url("static/icons8-checkmark-24-external-active.png"); 69 | background-repeat: none; 70 | background-size: cover; 71 | } 72 | 73 | .divider{ 74 | 75 | width: 100%; 76 | height: 8px; 77 | background-color:#0055A4; 78 | border: 0 none; 79 | margin-top: 20px; 80 | margin-bottom:20px; 81 | 82 | } 83 | 84 | .line{ 85 | border-right:1px solid black; 86 | } 87 | 88 | .mylink{padding: 5px; 89 | font-size: 14px;} 90 | 91 | .mylink:any-link { 92 | color:black; 93 | height: fit-content; 94 | } 95 | 96 | 97 | #email{ 98 | background-image: url("icons8-email-send-24.png"); 99 | /*background-repeat: none; 100 | background-size: cover; 101 | border:none; */ 102 | 103 | } 104 | 105 | 106 | .attribution{ 107 | display: flex; 108 | justify-content: flex-end; 109 | font-size: 10px; 110 | color:grey; 111 | } 112 | 113 | -------------------------------------------------------------------------------- /inst/rmd/0_frontmatter.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: 3 | word_document: 4 | pandoc_args: ["--metadata-file=header.yaml"] 5 | reference_docx: styles_reference.docx 6 | --- 7 | 8 | ```{r setup, include=FALSE} 9 | knitr::opts_chunk$set(echo = FALSE, warning = FALSE, error = FALSE) 10 | ``` 11 | 12 | ```{r} 13 | report_office_location <- " > [Office Location]" # CHANGE 14 | # For example: 15 | # "National Oceanic and Atmospheric Administration\n 16 | # 1315 East-West Highway [bldg./room]\n 17 | # Silver Spring, MD 20910"\n 18 | report_office <- "" # For example: AFSC, NEFSC # CHANGE 19 | report_num <- "###" # CHANGE 20 | report_NOAA_leaders <- "U.S. Department of Commerce 21 | 22 | Wynn Coggins, Acting Secretary 23 | 24 | 25 | National Oceanic and Atmospheric Administration 26 | 27 | Benjamin Friedman, Acting NOAA Administrator 28 | 29 | 30 | National Marine Fisheries Service 31 | 32 | Paul Doremus, Acting Assistant Administrator for Fisheries" 33 | ``` 34 | 35 |
36 | 37 | # `r report_title ` 38 | 39 | By 40 | 41 | `r report_authors ` 42 | 43 | 44 |
45 | 46 | 47 | 48 | ![](../img/DeptOfCommerce.jpg){width=25%} 49 | 50 | 51 | U.S. Department of Commerce 52 | 53 | National Oceanic and Atmospheric Administration 54 | 55 | National Marine Fisheries Service 56 | 57 | 58 | `r report_office_location` 59 | 60 | `r months(Sys.Date()) ` `r as.numeric(format(as.Date(Sys.Date(),'%Y-%m-%d'),'%Y')) ` 61 | 62 | \newpage 63 | 64 | 65 |
66 | 67 | 68 | # `r report_title ` 69 | 70 | 71 | By 72 | 73 | 74 | `r report_authors ` 75 | 76 |
77 | 78 | 79 | **NOAA Technical Memorandum NMFS-[`r report_office`]-`r report_num` `r months(Sys.Date()) ` `r as.numeric(format(as.Date(Sys.Date(),'%Y-%m-%d'),'%Y')) ` 80 | ** 81 | 82 | 83 | ![](../img/noaa-gray.png){width=20%} 84 | 85 | `r report_NOAA_leaders` 86 | 87 | 88 | \newpage 89 | 90 | 91 | 92 | **Recommended citation:** 93 | 94 | `r report_authors `. `r report_yr `. `r report_title ` NOAA Tech. Memo. NMFS-[`r report_office`]-`r report_num`, 95 | 96 | > ## p. 97 | 98 | 99 | 100 | **Copies of this report may be obtained from:** 101 | 102 | 103 | `r report_office_location` 104 | 105 | **Or online at:** 106 | 107 | http://spo.nmfs.noaa.gov/tech-memos/ 108 | 109 | > [or alternate URL for OHC, OSF or OPR pages] 110 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /man/crossref.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NMFSReports.R 3 | \name{crossref} 4 | \alias{crossref} 5 | \title{Reference a figure, table, or equation with an anchored tag} 6 | \usage{ 7 | crossref(list_obj, nickname, sublist = "number", exact = TRUE, text = TRUE) 8 | } 9 | \arguments{ 10 | \item{list_obj}{A list object created by list_figures or list_tables.} 11 | 12 | \item{nickname}{A unique string that is used to identify the plot or table in list_figures or list_tables, respectively.} 13 | 14 | \item{sublist}{A string of the sublist in list_figures or list_tables you want the contents returned from.} 15 | 16 | \item{exact}{T/F. If TRUE, 'nickname' must match the name of the list item exactly. If FALSE, crossref will return all entries with that string fragment. Default = TRUE.} 17 | 18 | \item{text}{T/F. If TRUE, will output results prepared for a text output. If FALSE, will output each element. Default = TRUE.} 19 | } 20 | \value{ 21 | The item in the list. 22 | } 23 | \description{ 24 | Reference a figure, table, or equation with an anchored tag 25 | } 26 | \examples{ 27 | list_figures <- c() 28 | table_raw <- data.frame(x = 1, y = 1) 29 | pp <- plot(x = table_raw$x, y = table_raw$y) 30 | list_figures <- NMFSReports::save_figures( 31 | figure = pp, 32 | list_figures = list_figures, 33 | header = "blah blah blah", 34 | nickname = "example_1", # a unique name you can refer back to 35 | cnt_chapt_content = "003", 36 | cnt = "012") 37 | list_figures <- NMFSReports::save_figures( 38 | figure = pp, 39 | list_figures = list_figures, 40 | header = "blah blah blah", 41 | nickname = "example2", # a unique name you can refer back to 42 | cnt_chapt_content = "003", 43 | cnt = "013") 44 | list_figures 45 | refnum <- crossref( 46 | list_obj = list_figures, 47 | nickname = "example_1", 48 | sublist = "number") 49 | refnum 50 | print(paste0("Please refer to figure ", refnum, 51 | " to see this figure, not the other figure.")) 52 | # example using a partial phrase with `exact = FALSE` 53 | crossref( 54 | list_obj = list_figures, 55 | nickname = "example_", 56 | sublist = "number", 57 | exact = FALSE) 58 | # using a wildard with `exact = FALSE` 59 | crossref( 60 | list_obj = list_figures, 61 | nickname = "example*1", 62 | sublist = "number", 63 | exact = FALSE) 64 | crossref( 65 | list_obj = list_figures, 66 | nickname = "example*", 67 | sublist = "number", 68 | exact = FALSE, 69 | text = FALSE) 70 | refnum <- crossref( 71 | list_obj = list_figures, 72 | nickname = "example*", 73 | sublist = "number", 74 | exact = FALSE, 75 | text = TRUE) 76 | refnum 77 | print(paste0("Please refer to figure ", refnum, 78 | " to see this figure, not the other figure.")) 79 | } 80 | -------------------------------------------------------------------------------- /inst/rmd/run.R: -------------------------------------------------------------------------------- 1 | #' --- 2 | #' title: # INSERT_REPORT_TITLE 3 | #' author: # INSERT_AUTHOR 4 | #' purpose: Run Scripts and R Markdown Files 5 | #' start date: # YYYY-MM-DD 6 | #' date modified: # YYYY-MM-DD # CHANGE 7 | #' Notes: # CHANGE 8 | #' --- 9 | 10 | # START ------------------------------------------------------------------------ 11 | 12 | # *** REPORT KNOWNS ------------------------------------------------------------ 13 | report_title <- # INSERT_REPORT_TITLE 14 | report_authors <- # INSERT_AUTHOR 15 | report_yr <- substr(x = Sys.Date(), start = 1, stop = 4) # SUGGESTION 16 | 17 | # *** OUTPUT TYPE -------------------------------------------------------------- 18 | #Is this for InDesign? 19 | indesign_flowin <- FALSE 20 | 21 | # *** SOURCE SUPPORT SCRIPTS --------------------------------------------------- 22 | 23 | # INSERT_SUPPORT_SCRIPTS 24 | 25 | # *** RENV: SAVE PACKAGES USED TO CREATE THIS REPORT --------------------------- 26 | # renv::init() 27 | # renv::snapshot() 28 | 29 | # *** SIGN INTO GOOGLE DRIVE---------------------------------------------------- 30 | 31 | # googledrive::drive_deauth() 32 | # googledrive::drive_auth() 33 | # 1 34 | 35 | # RUN FIGURES, TABLES, & EQUATIONS FOR REPORT ---------------------------------- 36 | 37 | if (FALSE) { 38 | cnt_chapt_content<-"000" 39 | filename0<-paste0(cnt_chapt, "_") 40 | rmarkdown::render(paste0(dir_code, "/0_figtab.Rmd"), 41 | output_dir = dir_out_ref, 42 | output_file = paste0(filename0, cnt_chapt_content, ".docx")) 43 | 44 | save(list_figures, file=paste0(dir_out_figures, "/report_figures.rdata")) 45 | save(list_tables, file=paste0(dir_out_tables, "/report_tables.rdata")) 46 | save(list_equations, file=paste0(dir_out_tables, "/report_equations.rdata")) 47 | } 48 | 49 | load(file = paste0(dir_out_figures, "/report_figures.rdata")) 50 | load(file = paste0(dir_out_tables, "/report_tables.rdata")) 51 | load(file = paste0(list_equations, "/report_equations.rdata")) 52 | 53 | # RUN EACH REPORT SECTION ------------------------------------------------------ 54 | 55 | # *** RUN EACH REPORT SECTION -------------------------------------------------- 56 | 57 | # INSERT_SECTIONS 58 | 59 | # MAKE MASTER DOCX ------------------------------------------------------------- 60 | 61 | #USE GUIDENCE FROM THIS LINK 62 | #https://support.microsoft.com/en-us/help/2665750/how-to-merge-multiple-word-documents-into-one 63 | 64 | # SAVE METADATA ---------------------------------------------------------------- 65 | 66 | con <- file(paste0(dir_out_todaysrun, "metadata.log")) 67 | sink(con, append=TRUE) 68 | sessionInfo() 69 | sink() # Restore output to console 70 | # cat(readLines("notes.log"), sep="\n") # Look at the log 71 | 72 | -------------------------------------------------------------------------------- /man/add_table_footnotes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NMFSReports.R 3 | \name{add_table_footnotes} 4 | \alias{add_table_footnotes} 5 | \title{Add footnotes within your tables in a smart way} 6 | \usage{ 7 | add_table_footnotes( 8 | table, 9 | footnote = NULL, 10 | from_col = "", 11 | to_col = "", 12 | from_row = "", 13 | to_row = "", 14 | delim = ",,," 15 | ) 16 | } 17 | \arguments{ 18 | \item{table}{The data.frame you are adding footnotes to (and possibly from).} 19 | 20 | \item{footnote}{A string that you want to add as a footnote to the table. Optional.} 21 | 22 | \item{from_col}{What column number or name you want to pull footnotes from.} 23 | 24 | \item{to_col}{What column number or name you want add footnotes to.} 25 | 26 | \item{from_row}{What row number or name you want to pull footnotes from.} 27 | 28 | \item{to_row}{What row number or name you want add footnotes to.} 29 | 30 | \item{delim}{A deliminator string that seperates if you have multiple footnotes stored in a cell. The deliminator can be anything, as long as it does not conflict with anything that can be interpreted by regex. Default = "&&&"} 31 | } 32 | \value{ 33 | The table "tab" with the footnotes inserted into the table. 34 | } 35 | \description{ 36 | Add footnotes within your tables in a smart way 37 | } 38 | \examples{ 39 | table<-data.frame(col = LETTERS[1:10], 40 | x = rnorm(n = 10), 41 | y = rnorm(n = 10), 42 | footnotes = NA) 43 | table$footnotes[3]<-"Example footnote in a table 1." 44 | table$footnotes[4]<-"Example footnote in a table 2.&&&Example footnote in a table 3." 45 | table[,c("x", "y")] <- NMFSReports::mod_number(table[,c("x", "y")], 46 | divideby = 1, #' 47 | comma_seperator = TRUE, 48 | digits = 2) 49 | # Here, add footnotes from the "footnotes" column to the content in the first column where necessary 50 | table <- add_table_footnotes(tab = table, 51 | from_col = "footnotes", # either use the name of the column 52 | to_col = 1) # or the number of that column in that table 53 | # Here, add a specific footnote to a specific place in the table 54 | table <- add_table_footnotes(tab = table, 55 | footnote = "Example footnote in a table 4.", 56 | to_row = 2, 57 | to_col = 2) 58 | table <- add_table_footnotes(tab = table, 59 | footnote = c("Example footnote in a table 5.", 60 | "Example footnote in a table 6."), 61 | to_row = 4, 62 | to_col = 2) 63 | knitr::kable(table) 64 | } 65 | -------------------------------------------------------------------------------- /inst/rmd/1_functions.R: -------------------------------------------------------------------------------- 1 | #' --- 2 | #' title: # INSERT_REPORT_TITLE 3 | #' author: # INSERT_AUTHOR 4 | #' purpose: Store functions 5 | #' start date: # YYYY-MM-DD 6 | #' date modified: # YYYY-MM-DD # CHANGE 7 | #' Notes: # CHANGE 8 | #' --- 9 | 10 | # Install libraries ------------------------------------------------------------- 11 | 12 | # Here we list all the packages we will need for this whole process 13 | # We'll also use this in our works cited page!!! 14 | PKG <- c( 15 | # For creating R Markdown Docs 16 | "knitr", # A general-purpose tool for dynamic report generation in R 17 | "rmarkdown", # R Markdown Document Conversion 18 | 19 | # File Management 20 | # "here", # For finding the root directory of your scripts and thus, find your files 21 | "officer", 22 | 23 | # Keeping Organized 24 | "devtools", # Package development tools for R; used here for downloading packages from GitHub 25 | # "renv", # saves the packages in the R environment 26 | 27 | 28 | # Graphics 29 | "ggplot2", # Create Elegant Data Visualisations Using the Grammar of Graphics 30 | # "nmfspalette", # devtools::install_github("nmfs-general-modeling-tools/nmfspalette" 31 | "cowplot", 32 | "png", 33 | "extrafont", 34 | 35 | # Text 36 | "NMFSReports", # devtools::install_github("emilymarkowitz-noaa/NMFSReports") # Package of my favorite grammar and file managment functions for writing reproducible reports 37 | 38 | # Citations 39 | "knitcitations", # devtools::install_github("cboettig/knitcitations") 40 | 41 | # other tidyverse 42 | "dplyr", 43 | "magrittr", 44 | 45 | # Text Management 46 | "stringr", 47 | 48 | # For outputting JS files 49 | "jsonlite") 50 | 51 | 52 | PKG <- unique(PKG) 53 | for (p in PKG) { 54 | if(!require(p,character.only = TRUE)) { 55 | install.packages(p) 56 | require(p,character.only = TRUE)} 57 | } 58 | 59 | loadfonts(device = "win") 60 | 61 | # renv ------------------------------------------------------------------ 62 | 63 | # renv::snapshot() 64 | 65 | 66 | # Cite R Packages -------------------------------------------------------- 67 | 68 | knitr::write_bib(x = PKG, 69 | file = paste0(dir_out_rawdata, "bibliography_RPack.bib")) 70 | 71 | file.copy(from = paste0(dir_out_rawdata, "bibliography_RPack.bib"), 72 | to = paste0(dir_cite,"/bibliography_RPack.bib"), 73 | overwrite = TRUE) 74 | 75 | 76 | # Housekeeping ----------------------------------------------------------------- 77 | 78 | # Keep chapter content in a proper order 79 | cnt_chapt <- "000" 80 | # Automatically name objects with consecutive numbers 81 | cnt_figures <- 0 # e.g., Figure 1 82 | cnt_tables <- 0 # e.g., Table 1 83 | cnt_equations <- 0 # e.g., Equation 1 84 | # Save object content 85 | list_equations <- list() 86 | list_tables <- list() 87 | list_figures <- list() 88 | 89 | # Functions ------------------------------------------------------------- 90 | 91 | ################Functions############# 92 | 93 | -------------------------------------------------------------------------------- /man/save_tables.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NMFSReports.R 3 | \name{save_tables} 4 | \alias{save_tables} 5 | \title{Systematically save your report tables for your report} 6 | \usage{ 7 | save_tables( 8 | table_raw = NULL, 9 | table_print = NULL, 10 | list_tables = c(), 11 | header = "", 12 | footnotes = "", 13 | filename0 = "x", 14 | cnt_chapt_content = "001", 15 | cnt = "1", 16 | path = NULL, 17 | output_type = c("csv"), 18 | type = "Table", 19 | alttext = "", 20 | filename_desc = "", 21 | nickname = "", 22 | message = FALSE 23 | ) 24 | } 25 | \arguments{ 26 | \item{table_raw}{Optional. The data.frame that has no rounding and no dividing of numbers (good to save this for record keeping). Default = NA.} 27 | 28 | \item{table_print}{The data.frame as table will be seen in the report.} 29 | 30 | \item{list_tables}{Save tables in a list} 31 | 32 | \item{header}{The name and title of the figure. Default = "".} 33 | 34 | \item{footnotes}{Any footnote you want attached to this figure.} 35 | 36 | \item{filename0}{The filename set at the begining of the chapter} 37 | 38 | \item{cnt_chapt_content}{The order number that this exists in the chapter.} 39 | 40 | \item{cnt}{The figure number} 41 | 42 | \item{path}{The path the file needs to be saved to. Default = "NULL", meaning it wont save anything and will override all other saving elements.} 43 | 44 | \item{output_type}{Default = c("csv"). Can be anything supported by utils::write.table.} 45 | 46 | \item{type}{Default = "Table", but can be anything that the element needs to be called (e.g., "Graphic", "Fig.", "Graph") to fit in the phrase "Table 1. This is my spreadsheet!".} 47 | 48 | \item{alttext}{String with what the alternative text is.} 49 | 50 | \item{filename_desc}{Additional description text for the filename that will be added at the name of file before the filename extention, before the "_raw" or "_print". Default = "". Can be use to add a species name, location, or anything else that would make it easier to know what that file shows.} 51 | 52 | \item{nickname}{A unique name that can be used to identify the figure so it can be referenced later in the report.} 53 | 54 | \item{message}{TRUE/FALSE. Default = FALSE. If TRUE, it will print information about where your plot has been saved to.} 55 | } 56 | \description{ 57 | Systematically save your report tables for your report 58 | } 59 | \examples{ 60 | # Select data and make plot 61 | table_raw<-data.frame(x = rnorm(n = 10), 62 | y = rnorm(n = 10), 63 | col = rep_len(x = c("a", "b"), length.out = 5)) 64 | table_print <- table_raw 65 | table_print[,c("x", "y")] <- NMFSReports::mod_number(table_print[,c("x", "y")], 66 | divideby = 1, 67 | comma_seperator = TRUE, 68 | digits = 2) 69 | save_tables(table_raw = table_raw, 70 | table_print=table_print, 71 | header = "Here is a table!", 72 | footnote = "A footnote for this table!") 73 | } 74 | -------------------------------------------------------------------------------- /pkgdown/_pkgdown.yml: -------------------------------------------------------------------------------- 1 | url: https://emilymarkowitz-noaa.github.io/NMFSReports/ 2 | 3 | news: 4 | one_page: true 5 | 6 | navbar: 7 | left: 8 | - text: "Vignettes" 9 | icon: fas fa-book fa-lg 10 | menu: 11 | - text: "Overview" 12 | href: articles/index.html 13 | - text: "Use buildReport() to begin writing Your report" 14 | href: articles/A_use-buildReport.html 15 | - text: "How to use the run.R file to be the skeleton of your report" 16 | href: articles/B_run-script-demo.html 17 | - text: "Functions and examples to help you write your report" 18 | href: articles/C_functions-to-help-write-report.html 19 | - text: "Use {googledrive} to access documents from Google Drive made collaboratively with coworkers" 20 | href: https://github.com/RVerse-Tutorials/GoogleDrive1 21 | - text: "Notes on the system and packges used to build this package" 22 | href: articles/E_thispkgwasbuiltusing.html 23 | 24 | - text: "Functions" 25 | icon: far fa-file-code fa-lg 26 | href: reference/index.html 27 | - text: "News" 28 | icon: fas fa-bullhorn fa-lg 29 | href: news/index.html 30 | right: 31 | - icon: fas fa-paper-plane fa-lg 32 | href: mailto:emily.markowitz@noaa.gov 33 | - icon: fas fa-question-circle fa-lg 34 | href: https://github.com/EmilyMarkowitz-NOAA/NMFSReports/issues/ 35 | - icon: fab fa-github fa-lg 36 | href: https://github.com/EmilyMarkowitz-NOAA/NMFSReports 37 | - icon: fa-fish 38 | href: https://nmfs-general-modeling-tools.github.io/ 39 | 40 | articles: 41 | - title: "NMFS Reports Vignettes" 42 | desc: > 43 | These vignettes provide an introduction to how to rewite reports using the 44 | **NMFSReports** package.
45 |
46 | contents: 47 | - A_use-buildReport 48 | - B_run-script-demo 49 | - C_functions-to-help-write-report 50 | - E_thispkgwasbuiltusing 51 | 52 | reference: 53 | - title: Build the Report Architecture 54 | contents: 55 | - '`buildReport`' 56 | - title: Search within Report Content 57 | contents: 58 | - '`is_something_in_this_matrix`' 59 | - title: Work with Text 60 | contents: 61 | - '`add_table_footnotes`' 62 | - '`text_list`' 63 | - '`TitleCase`' 64 | - '`tolower2`' 65 | - '`googledrive_txt_dl`' 66 | - title: Work with Numbers in Text 67 | contents: 68 | - '`format_cells`' 69 | - '`numbers2words`' 70 | - '`numbers2words_th`' 71 | - '`mod_number`' 72 | - '`pchange`' 73 | - '`xunits`' 74 | - '`xunitspct`' 75 | - '`stndth`' 76 | - '`range_text`' 77 | - title: File and Content Organization 78 | contents: 79 | - '`auto_counter`' 80 | - '`numbers0`' 81 | - title: Tables and Graphs 82 | contents: 83 | - '`save_figures`' 84 | - '`save_tables`' 85 | - '`save_equations`' 86 | - '`crossref`' 87 | - '`theme_flextable_nmfstm`' 88 | - title: Record Metadata 89 | contents: 90 | - '`create_metadata`' 91 | - title: Others 92 | contents: 93 | - '`df2js`' 94 | - '`url_exists`' 95 | -------------------------------------------------------------------------------- /inst/rmd/1_directories.R: -------------------------------------------------------------------------------- 1 | #' --- 2 | #' title: # INSERT_REPORT_TITLE 3 | #' author: # INSERT_AUTHOR 4 | #' purpose: Store functions 5 | #' start date: # YYYY-MM-DD 6 | #' date modified: # YYYY-MM-DD # CHANGE 7 | #' Notes: # CHANGE 8 | #' --- 9 | 10 | 11 | 12 | 13 | # SAVE FILE LOCATIONS ---------------------------------------------------------- 14 | # Just in case you change the base name for any reason, it will change for anytime you load the files inside the folder, too! (e.g., if you have something against "scripts" being the name of the folder, just let the script know in one place aka right here). 15 | 16 | # Directories to all of your current folders 17 | dir_in<-paste0(getwd(), "/") 18 | dirs<-list.dirs(path = getwd(), full.names = FALSE) 19 | dirs<-dirs[!grepl(pattern = "\\/", x = dirs)] 20 | dirs<-dirs[!grepl(pattern = "\\..", x = dirs)] 21 | dirs<-dirs[dirs != ""] 22 | for (i in 1:length(dirs)) { 23 | assign(x = paste0("dir_", dirs[i]), 24 | value = paste0(dir_in, (dirs[i]), "/")) 25 | } 26 | 27 | # Where we save everything 28 | dir.output<-paste0(dir_in, "/output/") 29 | dir_out_todaysrun<-paste0(dir.output, "/",Sys.Date(),"/") 30 | dir.create(dir_out_todaysrun) 31 | 32 | dirs <- c("chapters", "rawdata", "documentation", "code", "figures", "tables", "cite") 33 | for (i in 1:length(dirs)) { 34 | if (dir.exists(paste0(dir_out_todaysrun, dirs[i])) == FALSE) { 35 | dir.create(paste0(dir_out_todaysrun, "/", dirs[i])) 36 | } 37 | assign(x = paste0("dir_out_", dirs[i]), value = paste0(dir_out_todaysrun, "/",dirs[i],"/")) 38 | } 39 | 40 | # If loading in InDesign, table and figure headers need to be their own .docx. Here's a file that will do that for you. 41 | # TableFigureHeader<-system.file("rmd", "TableFigureHeader.Rmd", package = "RMarkReports") 42 | 43 | TableFigureHeader<-paste0(dir_code, "TableFigureHeader.Rmd") 44 | 45 | options("citation_format" = "pandoc") 46 | 47 | # SAVE ALL R FILES USED FOR EACH RUN ------------------------------------------- 48 | listfiles<-list.files(path = dir_code) 49 | listfiles0<-c(listfiles[grepl(pattern = "\\.r", 50 | x = listfiles, ignore.case = T)], 51 | listfiles[grepl(pattern = "\\.pptx", 52 | x = listfiles, ignore.case = T)], 53 | listfiles[grepl(pattern = "\\.docx", 54 | x = listfiles, ignore.case = T)]) 55 | listfiles0<-listfiles0[!(grepl(pattern = "~",ignore.case = T, x = listfiles0))] 56 | 57 | for (i in 1:length(listfiles0)){ 58 | file.copy(from = paste0(dir_code, listfiles0[i]), 59 | to = paste0(dir_out_code, listfiles0[i]), 60 | overwrite = T) 61 | } 62 | 63 | # SAVE ALL CITE FILES USED FOR EACH RUN ---------------------------------------- 64 | listfiles0<-list.files(path = dir_cite) 65 | listfiles0<-listfiles0[!(grepl(pattern = "~",ignore.case = T, x = listfiles0))] 66 | 67 | for (i in 1:length(listfiles0)){ 68 | file.copy(from = paste0(dir_cite, listfiles0[i]), 69 | to = paste0(dir_out_cite, listfiles0[i]), 70 | overwrite = T) 71 | } 72 | 73 | # CITATION STYLE --------------------------------------------------------------- 74 | options("citation_format" = "pandoc") 75 | -------------------------------------------------------------------------------- /man/save_figures.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NMFSReports.R 3 | \name{save_figures} 4 | \alias{save_figures} 5 | \title{Systematically save your figures for your report} 6 | \usage{ 7 | save_figures( 8 | figure, 9 | list_figures, 10 | header = "", 11 | footnotes = "", 12 | filename0 = "x", 13 | cnt_chapt_content = "001", 14 | cnt = 1, 15 | path = NULL, 16 | width = 6, 17 | height = 6, 18 | output_type = c("pdf", "png"), 19 | type = "Figure", 20 | alttext = "", 21 | filename_desc = "", 22 | nickname = "", 23 | raw = NULL, 24 | message = FALSE 25 | ) 26 | } 27 | \arguments{ 28 | \item{figure}{The figure you would like to be saved.} 29 | 30 | \item{list_figures}{The list where all figures will be saved.} 31 | 32 | \item{header}{The name and title of the figure. Default = "".} 33 | 34 | \item{footnotes}{Any footnote you want attached to this figure.} 35 | 36 | \item{filename0}{The filename set at the begining of the chapter.} 37 | 38 | \item{cnt_chapt_content}{The order number that this exists in the chapter.} 39 | 40 | \item{cnt}{The figure number.} 41 | 42 | \item{path}{The path the file needs to be saved to. Default = "NULL", meaning it wont save anything and will override all other saving elements.} 43 | 44 | \item{width}{Default = 6 inches.} 45 | 46 | \item{height}{Default = 6 inches.} 47 | 48 | \item{output_type}{Default = c("pdf", "png"). Can be anything supported by ggsave().} 49 | 50 | \item{type}{Default = "Figure", but can be anything that the element needs to be called (e.g., "Graphic", "Fig.", "Graph") to fit in the phrase "Figure 1. This is my plot!".} 51 | 52 | \item{alttext}{String with what the alternative text is.} 53 | 54 | \item{filename_desc}{Additional description text for the filename that will be added at the name of file before the filename extention. Can be use to add a species name, location, or anything else that would make it easier to know what that file shows.} 55 | 56 | \item{nickname}{A unique name that can be used to identify the figure so it can be referenced later in the report.} 57 | 58 | \item{raw}{Optional. The data.frame or other data that has no rounding and no dividing of numbers (good to save this for record keeping) and was used to create the figure. Default = NA.} 59 | 60 | \item{message}{TRUE/FALSE. Default = FALSE. If TRUE, it will print information about where your plot has been saved to.} 61 | } 62 | \value{ 63 | list_figures updated with the new plot and metadata. 64 | } 65 | \description{ 66 | Systematically save your figures for your report 67 | } 68 | \examples{ 69 | library(magrittr) 70 | library(ggplot2) 71 | list_figures <- c() 72 | dat <- data.frame(x = rnorm(n = 10), 73 | y = rnorm(n = 10), 74 | col = rep_len(x = c("a", "b"), 75 | length.out = 5)) 76 | # Select data and make plot 77 | figure<- dat \%>\% 78 | ggplot(aes(x = x, y = y, 79 | colour = as.factor(col))) + # create plot 80 | geom_point() 81 | list_figures<-save_figures(figure = figure, 82 | list_figures = list_figures, 83 | header = "example", 84 | footnote = "footnote example") 85 | names(list_figures) 86 | list_figures 87 | } 88 | -------------------------------------------------------------------------------- /docs/pkgdown.js: -------------------------------------------------------------------------------- 1 | /* http://gregfranko.com/blog/jquery-best-practices/ */ 2 | (function($) { 3 | $(function() { 4 | 5 | $('.navbar-fixed-top').headroom(); 6 | 7 | $('body').css('padding-top', $('.navbar').height() + 10); 8 | $(window).resize(function(){ 9 | $('body').css('padding-top', $('.navbar').height() + 10); 10 | }); 11 | 12 | $('[data-toggle="tooltip"]').tooltip(); 13 | 14 | var cur_path = paths(location.pathname); 15 | var links = $("#navbar ul li a"); 16 | var max_length = -1; 17 | var pos = -1; 18 | for (var i = 0; i < links.length; i++) { 19 | if (links[i].getAttribute("href") === "#") 20 | continue; 21 | // Ignore external links 22 | if (links[i].host !== location.host) 23 | continue; 24 | 25 | var nav_path = paths(links[i].pathname); 26 | 27 | var length = prefix_length(nav_path, cur_path); 28 | if (length > max_length) { 29 | max_length = length; 30 | pos = i; 31 | } 32 | } 33 | 34 | // Add class to parent
  • , and enclosing
  • if in dropdown 35 | if (pos >= 0) { 36 | var menu_anchor = $(links[pos]); 37 | menu_anchor.parent().addClass("active"); 38 | menu_anchor.closest("li.dropdown").addClass("active"); 39 | } 40 | }); 41 | 42 | function paths(pathname) { 43 | var pieces = pathname.split("/"); 44 | pieces.shift(); // always starts with / 45 | 46 | var end = pieces[pieces.length - 1]; 47 | if (end === "index.html" || end === "") 48 | pieces.pop(); 49 | return(pieces); 50 | } 51 | 52 | // Returns -1 if not found 53 | function prefix_length(needle, haystack) { 54 | if (needle.length > haystack.length) 55 | return(-1); 56 | 57 | // Special case for length-0 haystack, since for loop won't run 58 | if (haystack.length === 0) { 59 | return(needle.length === 0 ? 0 : -1); 60 | } 61 | 62 | for (var i = 0; i < haystack.length; i++) { 63 | if (needle[i] != haystack[i]) 64 | return(i); 65 | } 66 | 67 | return(haystack.length); 68 | } 69 | 70 | /* Clipboard --------------------------*/ 71 | 72 | function changeTooltipMessage(element, msg) { 73 | var tooltipOriginalTitle=element.getAttribute('data-original-title'); 74 | element.setAttribute('data-original-title', msg); 75 | $(element).tooltip('show'); 76 | element.setAttribute('data-original-title', tooltipOriginalTitle); 77 | } 78 | 79 | if(ClipboardJS.isSupported()) { 80 | $(document).ready(function() { 81 | var copyButton = ""; 82 | 83 | $("div.sourceCode").addClass("hasCopyButton"); 84 | 85 | // Insert copy buttons: 86 | $(copyButton).prependTo(".hasCopyButton"); 87 | 88 | // Initialize tooltips: 89 | $('.btn-copy-ex').tooltip({container: 'body'}); 90 | 91 | // Initialize clipboard: 92 | var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { 93 | text: function(trigger) { 94 | return trigger.parentNode.textContent.replace(/\n#>[^\n]*/g, ""); 95 | } 96 | }); 97 | 98 | clipboardBtnCopies.on('success', function(e) { 99 | changeTooltipMessage(e.trigger, 'Copied!'); 100 | e.clearSelection(); 101 | }); 102 | 103 | clipboardBtnCopies.on('error', function() { 104 | changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); 105 | }); 106 | }); 107 | } 108 | })(window.jQuery || window.$) 109 | -------------------------------------------------------------------------------- /man/buildReport.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NMFSReports.R 3 | \name{buildReport} 4 | \alias{buildReport} 5 | \title{Build your intitial architecture for your new NOAA Tech Memo or Report} 6 | \usage{ 7 | buildReport( 8 | sections = c("abstract", "introduction", "methods", "results", "discussion", 9 | "endmatter", "presentation"), 10 | report_authors = "", 11 | report_title = "", 12 | styles_reference_pptx = "refppt_nmfs", 13 | styles_reference_docx = "refdoc_noaa_tech_memo", 14 | bibliography.bib = "bib_example", 15 | csl = "bulletin-of-marine-science" 16 | ) 17 | } 18 | \arguments{ 19 | \item{sections}{a string of the different sections of your report. Sections must be listed in order. Default = c("frontmatter", "abstract", "introduction", "methods", "results", "discussion", "endmatter"). Note that "frontmatter" and "endmatter" both have specific templates, and all others are from a blank template. "endmatter" will document all of your citations throughout the report, the R packages you used to create this report. I'm biased, but please give credit where credit is due! There are also spots here to list authors's ORCID and acknowlegelments.} 20 | 21 | \item{report_authors}{Default = "". Here, add all author's first and last name as it should appear in the report.You can change this later by editing this in the run.R file.} 22 | 23 | \item{report_title}{Default = "". Here, put the title of your report. You can change this later by editing this in the run.R file.} 24 | 25 | \item{styles_reference_pptx}{A style reference guide from a powerpoint document (.pptx). This pulls the styles from a powerpoint document where you have defined each style. Either use NULL to not have a presentation, a local document (insert full path to local document), or a pre-made templates ("refppt_nmfs"). Default = "refppt_nmfs". You can change this later by renaming the file in the code folder.} 26 | 27 | \item{styles_reference_docx}{A style reference guide from a word document (.docx). This pulls the styles from a word document where you have defined each style. Either use a local document (insert full path to local document) or some of the pre-made templates ("refdoc_noaa_tech_memo" or "refdoc_fisheries_economics_of_the_us"). Default = "refdoc_noaa_tech_memo". You can change this later by renaming the file in the code folder.} 28 | 29 | \item{bibliography.bib}{Either use a local document (.bib format; insert full "path") or the example file from the package ("bib_example"). Default = "bib_example". You can change this later by renaming the file in the cite folder.} 30 | 31 | \item{csl}{Citation style. Either use a local document (insert full path to local document) or some of the pre-made templates ("bulletin-of-marine-science"). A NOAA TM citation style needs to be created, but until then, the default = "bulletin-of-marine-science". You can change this later by renaming the file in the cite folder. Find citation styles at: https://github.com/citation-style-language/styles} 32 | } 33 | \value{ 34 | complete initial architecture for your R Markdown Report. 35 | } 36 | \description{ 37 | Build your intitial architecture for your new NOAA Tech Memo or Report 38 | } 39 | \examples{ 40 | sections = c("frontmatter", "abstract", "introduction", "methods", "results", 41 | "discussion", "endmatter") 42 | authors = "Me, Myself, and I" 43 | title = "Awesome Report!" 44 | styles_reference_pptx = "refppt_nmfs" 45 | styles_reference_docx = "refdoc_noaa_tech_memo" 46 | bibliography.bib = "bib_example" 47 | csl = "bulletin-of-marine-science" 48 | 49 | # not run: 50 | # buildReport( 51 | # sections = sections, 52 | # report_authors = authors, 53 | # report_title = title, 54 | # styles_reference_pptx = styles_reference_pptx, 55 | # styles_reference_docx = styles_reference_docx, 56 | # bibliography.bib = bibliography.bib, 57 | # csl = csl 58 | # ) 59 | } 60 | -------------------------------------------------------------------------------- /inst/cite/bulletin-of-marine-science.csl: -------------------------------------------------------------------------------- 1 | 2 | 101 | -------------------------------------------------------------------------------- /inst/icons/ref.txt: -------------------------------------------------------------------------------- 1 | Download the generated favicon and extract the contents to the root directory of your site. 2 | https://www.favicon-generator.org/download/2019-08-01/7afa02781bbe95ef02bad7c579740261.ico?largePack=1 3 | 4 | What's next? 5 | Include the following code in the head of your HTML document. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | Generate another favicon 25 | 26 | What are Favicons? 27 | Favicons are small 16x16 icon files that are displayed next to the URL of your site in a browser's address bar. Additionally they're often displayed next to the name of your site in a user's list of open tabs and bookmark listings making it easier for the user to quickly identify amongst other sites. 28 | 29 | What are App Icons? 30 | App Icons are the images you press on your smartphone to launch an application. As newer phones are released with higher resolution screens, higher resolution app icons are needed. Developers still want to maintain support for the older phones with lower resoltion so when you create an app icon you need to create several size variations of the same image. This is true for all smartphones like the iPhone and Android, and even tablets like iPad. 31 | 32 | What does this tool do? 33 | Although many modern web browsers support favicons saved as GIFs, PNGs or other popular file formats all versions of Internet Explorer still require favicons to be saved as ICO files (a Microsoft icon format). This tool provides an easy way to convert any GIF, PNG or JPEG to ICO which is supported by all modern web browsers. It also enables you to create favicons from scratch via a handy online editor. Additionally the editor lets you manually tweak generated favicons to ensure the best possible result. 34 | 35 | Using a favicon 36 | After generating a favicon with this tool download and save to the root directory of your site. Then include the following code in the head of your HTML document. 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /doc/A_use-buildReport.R: -------------------------------------------------------------------------------- 1 | ## ---- include = FALSE--------------------------------------------------------- 2 | knitr::opts_chunk$set( 3 | message = FALSE, echo = TRUE, warning = FALSE, 4 | comment = FALSE, collapse = TRUE, 5 | comment = "#>" 6 | ) 7 | options(rmarkdown.html_vignette.check_title = FALSE) 8 | 9 | ## ----setup-------------------------------------------------------------------- 10 | library(NMFSReports) 11 | 12 | ## ---- eval = FALSE------------------------------------------------------------ 13 | # # 1. Load the NMFSReports Library 14 | # library(devtools) 15 | # devtools::install_github("EmilyMarkowitz-NOAA/NMFSReports", force = TRUE) 16 | # library(NMFSReports) 17 | # 18 | # # 2. Build your report 19 | # 20 | # NMFSReports::buildReport( 21 | # sections = c("abstract", "introduction", "history", 22 | # "methods", "results", 23 | # "results_discussion", "endmatter", "presentation"), 24 | # report_authors = "Me, Myself, and I", 25 | # report_title = "The best report ever", 26 | # styles_reference_pptx = "refppt_nmfs", 27 | # styles_reference_docx = "refdoc_noaa_tech_memo", 28 | # bibliography.bib = "bib_example", 29 | # csl = "bulletin-of-marine-science" 30 | # ) 31 | # 32 | # # 3. Run your run.R file 33 | # source("./code/run.R") 34 | 35 | ## ----------------------------------------------------------------------------- 36 | report_title = "My Awesome Report!" 37 | 38 | ## ----------------------------------------------------------------------------- 39 | report_authors = "Me, Myself, and I" 40 | 41 | ## ----------------------------------------------------------------------------- 42 | # list the sections (that you will have different rmd scripts for) in order and with no spaces 43 | sections <- c("frontmatter", # This is a specific template that matches the NOAA Template 44 | "abstract", # This, and all others unless otherwise mentioned, come from the same plain-slate document but are appropriately named and linked up in the 'run' file. 45 | "introduction", 46 | "methods", 47 | "results", 48 | "discussion", 49 | "endmatter" # This is a specific template that will document all of your citations throughout the report, the R packages you used to create this report. I'm biased, but please give credit where credit is due! There are also spots here to list people's ORCID numbers and acknowlegements. 50 | ) 51 | 52 | ## ----------------------------------------------------------------------------- 53 | csl = "bulletin-of-marine-science" 54 | # it looks something like this: 55 | csl0 <- base::readLines(system.file("cite","bulletin-of-marine-science.csl", package="NMFSReports")) 56 | head(csl0) 57 | 58 | ## ----------------------------------------------------------------------------- 59 | csl = "bib_example" 60 | # it looks something like this: 61 | bib <- base::readLines(system.file("rmd","bib_example.bib", package="NMFSReports")) 62 | bib 63 | 64 | ## ---- eval = FALSE------------------------------------------------------------ 65 | # NMFSReports::buildReport( 66 | # sections = sections, 67 | # report_authors = report_authors, 68 | # report_title = report_title, 69 | # styles_reference_pptx = styles_reference_pptx, 70 | # styles_reference_docx = styles_reference_docx, 71 | # bibliography.bib = bibliography.bib, 72 | # csl = csl 73 | # ) 74 | 75 | ## ----------------------------------------------------------------------------- 76 | library(NMFSReports) 77 | # Input variables for buildReport() 78 | sections = c("coverpage", # This is a specific template for a 1 page coverpage 79 | "history", 80 | "studyimportance", 81 | "actions", 82 | "endmatter") # This is a specific template that will document all of your citations throughout the report, the R packages you used to create this report. I'm biased, but please give credit where credit is due! There are also spots here to list people's ORCID numbers and acknowlegements. 83 | report_authors = "Very important people" 84 | report_title = "Shorter Report!" 85 | styles_reference_pptx = "refpptx_nmfs" 86 | styles_reference_docx = "refdoc_fisheries_economics_of_the_us" 87 | bibliography.bib = "bib_example" 88 | # Find citation styles at: https://github.com/citation-style-language/styles 89 | csl0 <- read.delim(file = "https://raw.githubusercontent.com/citation-style-language/styles/master/american-fisheries-society.csl", header = FALSE, ) 90 | colnames(csl0)<-NULL 91 | rownames(csl0)<-NULL 92 | write.table(x = csl0, file = "csl.csl", 93 | quote = FALSE, row.names = FALSE, col.names = FALSE) 94 | csl = ("./csl.csl") 95 | head(csl0) 96 | 97 | ## ---- eval = FALSE------------------------------------------------------------ 98 | # # Run buildReport() function 99 | # NMFSReports::buildReport( 100 | # sections = sections, 101 | # report_authors = report_authors, 102 | # report_title = report_title, 103 | # styles_reference_pptx = styles_reference_pptx, 104 | # styles_reference_docx = styles_reference_docx, 105 | # bibliography.bib = bibliography.bib, 106 | # csl = csl 107 | # ) 108 | 109 | -------------------------------------------------------------------------------- /docs/sitemap.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | https://emilymarkowitz-noaa.github.io/NMFSReports/404.html 5 | 6 | 7 | https://emilymarkowitz-noaa.github.io/NMFSReports/articles/A_use-buildReport.html 8 | 9 | 10 | https://emilymarkowitz-noaa.github.io/NMFSReports/articles/B_run-script-demo.html 11 | 12 | 13 | https://emilymarkowitz-noaa.github.io/NMFSReports/articles/C_functions-to-help-write-report.html 14 | 15 | 16 | https://emilymarkowitz-noaa.github.io/NMFSReports/articles/D_googledrive.html 17 | 18 | 19 | https://emilymarkowitz-noaa.github.io/NMFSReports/articles/E_thispkgwasbuiltusing.html 20 | 21 | 22 | https://emilymarkowitz-noaa.github.io/NMFSReports/articles/index.html 23 | 24 | 25 | https://emilymarkowitz-noaa.github.io/NMFSReports/authors.html 26 | 27 | 28 | https://emilymarkowitz-noaa.github.io/NMFSReports/index.html 29 | 30 | 31 | https://emilymarkowitz-noaa.github.io/NMFSReports/LICENSE-text.html 32 | 33 | 34 | https://emilymarkowitz-noaa.github.io/NMFSReports/LICENSE.html 35 | 36 | 37 | https://emilymarkowitz-noaa.github.io/NMFSReports/news/index.html 38 | 39 | 40 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/add_table_footnotes.html 41 | 42 | 43 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/auto_counter.html 44 | 45 | 46 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/buildReport.html 47 | 48 | 49 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/CreateMetadata.html 50 | 51 | 52 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/create_metadata.html 53 | 54 | 55 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/crossref.html 56 | 57 | 58 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/df2js.html 59 | 60 | 61 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/format_cells.html 62 | 63 | 64 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/googledrive_txt_dl.html 65 | 66 | 67 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/index.html 68 | 69 | 70 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/is_something_in_this_matrix.html 71 | 72 | 73 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/mod_number.html 74 | 75 | 76 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/numbers0.html 77 | 78 | 79 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/numbers2words.html 80 | 81 | 82 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/numbers2words_th.html 83 | 84 | 85 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/pchange.html 86 | 87 | 88 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/range_text.html 89 | 90 | 91 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/ref_figtab.html 92 | 93 | 94 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/ref_listobject.html 95 | 96 | 97 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/save_equations.html 98 | 99 | 100 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/save_figures.html 101 | 102 | 103 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/save_graphs.html 104 | 105 | 106 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/save_tables.html 107 | 108 | 109 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/stndth.html 110 | 111 | 112 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/text_list.html 113 | 114 | 115 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/theme_flextable_nmfstm.html 116 | 117 | 118 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/TitleCase.html 119 | 120 | 121 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/tolower2.html 122 | 123 | 124 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/url_exists.html 125 | 126 | 127 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/xunits.html 128 | 129 | 130 | https://emilymarkowitz-noaa.github.io/NMFSReports/reference/xunitspct.html 131 | 132 | 133 | -------------------------------------------------------------------------------- /inst/rmd/_child_save_fig.Rmd: -------------------------------------------------------------------------------- 1 | 2 | 3 | ```{r, echo = FALSE} 4 | 5 | # Don't Edit This: 6 | subobj <- ifelse(exists("subobj"), subobj, FALSE) # create a subobj letter (1a) 7 | newobj <- ifelse(exists("newobj"), newobj, TRUE) # force a new object number (1b-> 2a and 1 -> 2) 8 | cnt_chapt_content<-NMFSReports::auto_counter(cnt_chapt_content) 9 | cnt_figures<-ifelse(newobj, cnt_figures+1, cnt_figures) 10 | 11 | if (subobj) { 12 | # if it contains letters 13 | if (newobj) { 14 | cnt_figures_sub <- cnt_figures_sub0 <- letters[1] 15 | } else { 16 | # cnt_figures_sub <- letters[which(letters == 17 | # gsub("[^a-zA-Z]", "", list_figures[length(list_figures)][[1]]$number))+1] 18 | cnt_figures_sub <- cnt_figures_sub0 <- letters[which(letters == cnt_figures_sub0)+1] 19 | } 20 | } else { 21 | cnt_figures_sub <- "" 22 | } 23 | 24 | if (!(exists("table_raw"))) { 25 | table_raw <- NULL 26 | } 27 | 28 | if (!exists("cnt_pre")) { 29 | cnt_pre <- "" 30 | # } else { 31 | # cnt_pre <- paste0(cnt_pre, " ") 32 | } 33 | 34 | 35 | # Systematically save your plot with this function 36 | list_figures<-NMFSReports::save_figures( 37 | figure = figure, 38 | raw = table_raw, 39 | list_figures = list_figures, 40 | header = ifelse(exists("header", mode = "character"), header, ""), 41 | footnotes = unlist(ifelse(exists("footnotes", mode = "character"), list(footnotes), "")), 42 | alttext = ifelse(exists("alttext", mode = "character"), alttext, header), 43 | filename0 = ifelse(exists("filename0", mode = "character"), filename0, nickname), 44 | nickname = ifelse(exists("nickname", mode = "character"), nickname, filename0), 45 | filename_desc = ifelse(exists("filename_desc", mode = "character"), filename_desc, nickname), 46 | cnt_chapt_content = ifelse(exists("cnt_chapt_content", mode = "character"), cnt_chapt_content, "001"), 47 | width = ifelse(exists("width", mode = "numeric"), width, 6), 48 | height = ifelse(exists("height", mode = "numeric"), height, 6), 49 | cnt = paste0(cnt_pre, cnt_figures, cnt_figures_sub), 50 | path = dir_out_figures) 51 | 52 | ``` 53 | 54 | ```{r, echo = FALSE, fig.alt = list_figures[[length(list_figures)]]$alttext, fig.scap = list_figures[[length(list_figures)]]$alttext, fig.align = 'center'} 55 | 56 | # fig.cap = ifelse(indesign_flowin %in% TRUE, list_figures[[length(list_figures)]]$alttext, paste0("\n#### *", list_figures[[length(list_figures)]]$header, "*")), 57 | 58 | # Print or Don't Print Plot in Text 59 | # You don't want to print this in the document if this text will be flowed into InDesign. 60 | # However, sometimes its nice to see everything all together, so this variable is 61 | # something you might like to toggle on and off. 62 | # Hense, FALSE = print here, TRUE = don't print here, just make the .pdf (coded above) 63 | if (indesign_flowin %in% FALSE) { 64 | 65 | if (!(exists("usePNGPDF"))) { 66 | list_figures[[length(list_figures)]]$figure # print plot in text 67 | } else if (usePNGPDF == "png") { 68 | knitr::include_graphics(path = paste0("..",gsub(pattern = dir_in, replacement = "", x = dir_out_figures), 69 | list_figures[nickname][[1]]$filename,".png"), 70 | error = FALSE) 71 | # cowplot::ggdraw() + 72 | # cowplot::draw_image(image = paste0(dir_out_figures, list_figures[nickname][[1]]$filename,".png")) 73 | # } else if (usePNGPDF == "pdf") { 74 | # cowplot::ggdraw() + 75 | # draw_image(magick::image_read_pdf(path = paste0(dir_out_figures, 76 | # list_figures[nickname][[1]]$filename,".pdf"), 77 | # density = 600)) 78 | # cowplot::ggdraw() + 79 | # cowplot::draw_image(image = paste0(dir_out_figures, list_figures[nickname][[1]]$filename,".pdf")) 80 | # knitr::include_graphics(path = paste0(dir_out_figures, 81 | # list_figures[nickname][[1]]$filename,".pdf")) 82 | } 83 | } else if (indesign_flowin %in% TRUE){ # for reports that need to be flowed into InDesign 84 | Title0 <- ifelse(indesign_flowin %in% TRUE, "", list_figures[[length(list_figures)]]$caption) 85 | rmarkdown::render(system.file("rmd/_TableFigureHeader.Rmd", package = "NMFSReports"), 86 | quiet = TRUE, 87 | output_dir = dir_chapters, 88 | output_file = paste0(filename00,cnt_chapt_content,"_Title.docx")) 89 | } 90 | 91 | # make sure you dont mistakenly name other files with these names 92 | remove_who <- c() 93 | remove_who0 <- c("figure", "table_raw", "header", "footnotes", "subobj", "newobj", #"nickname", 94 | "filename_desc", "alttext", "width", "height", "cnt_pre") 95 | for (i in 1:length(remove_who0)){ 96 | if(exists(remove_who0[i]) & !exists(remove_who0[i], mode = "function")){ 97 | remove_who <- c(remove_who, remove_who0[i]) 98 | } 99 | } 100 | remove(list = remove_who) 101 | 102 | ``` 103 | 104 | 105 | 106 | `r ifelse(indesign_flowin %in% TRUE, list_figures[[length(list_figures)]]$alttext, paste0("#### ", list_figures[[length(list_figures)]]$header)) ` 107 | 108 | 109 | 110 | 111 |
    112 | 113 | -------------------------------------------------------------------------------- /docs/bootstrap-toc.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) 3 | * Copyright 2015 Aidan Feldman 4 | * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ 5 | (function() { 6 | 'use strict'; 7 | 8 | window.Toc = { 9 | helpers: { 10 | // return all matching elements in the set, or their descendants 11 | findOrFilter: function($el, selector) { 12 | // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ 13 | // http://stackoverflow.com/a/12731439/358804 14 | var $descendants = $el.find(selector); 15 | return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); 16 | }, 17 | 18 | generateUniqueIdBase: function(el) { 19 | var text = $(el).text(); 20 | var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); 21 | return anchor || el.tagName.toLowerCase(); 22 | }, 23 | 24 | generateUniqueId: function(el) { 25 | var anchorBase = this.generateUniqueIdBase(el); 26 | for (var i = 0; ; i++) { 27 | var anchor = anchorBase; 28 | if (i > 0) { 29 | // add suffix 30 | anchor += '-' + i; 31 | } 32 | // check if ID already exists 33 | if (!document.getElementById(anchor)) { 34 | return anchor; 35 | } 36 | } 37 | }, 38 | 39 | generateAnchor: function(el) { 40 | if (el.id) { 41 | return el.id; 42 | } else { 43 | var anchor = this.generateUniqueId(el); 44 | el.id = anchor; 45 | return anchor; 46 | } 47 | }, 48 | 49 | createNavList: function() { 50 | return $(''); 51 | }, 52 | 53 | createChildNavList: function($parent) { 54 | var $childList = this.createNavList(); 55 | $parent.append($childList); 56 | return $childList; 57 | }, 58 | 59 | generateNavEl: function(anchor, text) { 60 | var $a = $(''); 61 | $a.attr('href', '#' + anchor); 62 | $a.text(text); 63 | var $li = $('
  • '); 64 | $li.append($a); 65 | return $li; 66 | }, 67 | 68 | generateNavItem: function(headingEl) { 69 | var anchor = this.generateAnchor(headingEl); 70 | var $heading = $(headingEl); 71 | var text = $heading.data('toc-text') || $heading.text(); 72 | return this.generateNavEl(anchor, text); 73 | }, 74 | 75 | // Find the first heading level (`

    `, then `

    `, etc.) that has more than one element. Defaults to 1 (for `

    `). 76 | getTopLevel: function($scope) { 77 | for (var i = 1; i <= 6; i++) { 78 | var $headings = this.findOrFilter($scope, 'h' + i); 79 | if ($headings.length > 1) { 80 | return i; 81 | } 82 | } 83 | 84 | return 1; 85 | }, 86 | 87 | // returns the elements for the top level, and the next below it 88 | getHeadings: function($scope, topLevel) { 89 | var topSelector = 'h' + topLevel; 90 | 91 | var secondaryLevel = topLevel + 1; 92 | var secondarySelector = 'h' + secondaryLevel; 93 | 94 | return this.findOrFilter($scope, topSelector + ',' + secondarySelector); 95 | }, 96 | 97 | getNavLevel: function(el) { 98 | return parseInt(el.tagName.charAt(1), 10); 99 | }, 100 | 101 | populateNav: function($topContext, topLevel, $headings) { 102 | var $context = $topContext; 103 | var $prevNav; 104 | 105 | var helpers = this; 106 | $headings.each(function(i, el) { 107 | var $newNav = helpers.generateNavItem(el); 108 | var navLevel = helpers.getNavLevel(el); 109 | 110 | // determine the proper $context 111 | if (navLevel === topLevel) { 112 | // use top level 113 | $context = $topContext; 114 | } else if ($prevNav && $context === $topContext) { 115 | // create a new level of the tree and switch to it 116 | $context = helpers.createChildNavList($prevNav); 117 | } // else use the current $context 118 | 119 | $context.append($newNav); 120 | 121 | $prevNav = $newNav; 122 | }); 123 | }, 124 | 125 | parseOps: function(arg) { 126 | var opts; 127 | if (arg.jquery) { 128 | opts = { 129 | $nav: arg 130 | }; 131 | } else { 132 | opts = arg; 133 | } 134 | opts.$scope = opts.$scope || $(document.body); 135 | return opts; 136 | } 137 | }, 138 | 139 | // accepts a jQuery object, or an options object 140 | init: function(opts) { 141 | opts = this.helpers.parseOps(opts); 142 | 143 | // ensure that the data attribute is in place for styling 144 | opts.$nav.attr('data-toggle', 'toc'); 145 | 146 | var $topContext = this.helpers.createChildNavList(opts.$nav); 147 | var topLevel = this.helpers.getTopLevel(opts.$scope); 148 | var $headings = this.helpers.getHeadings(opts.$scope, topLevel); 149 | this.helpers.populateNav($topContext, topLevel, $headings); 150 | } 151 | }; 152 | 153 | $(function() { 154 | $('nav[data-toggle="toc"]').each(function(i, el) { 155 | var $nav = $(el); 156 | Toc.init($nav); 157 | }); 158 | }); 159 | })(); 160 | -------------------------------------------------------------------------------- /notes.R: -------------------------------------------------------------------------------- 1 | 2 | # https://pkgdown.r-lib.org/reference/build_site.html 3 | 4 | # Wish list 5 | 6 | # Links to figures and tables in text 7 | # https://holtzy.github.io/Pimp-my-rmd/#internal_link 8 | 9 | ########### Document Package ############ 10 | .rs.restartR() 11 | 12 | # options(rmarkdown.html_vignette.check_title = FALSE) 13 | Sys.setenv('PATH' = paste0('C:/Program Files/qpdf-10.0.1/bin;', Sys.getenv('PATH'))) 14 | library(here) 15 | library(devtools) 16 | library(roxygen2) 17 | # rmarkdown::render(paste0(dir_code, "/README.Rmd"), 18 | # output_dir = here::here(), 19 | # output_file = paste0("README.md")) 20 | devtools::document() 21 | setwd("..") 22 | install("NMFSReports") 23 | 3 24 | setwd(here::here()) 25 | # devtools::check() 26 | 27 | ## Create Documentation GitHub-Pages ------------------------------------------- 28 | 29 | .rs.restartR() 30 | # devtools::install_github("rstudio/fontawesome", force = T) 31 | # library(fontawesome) 32 | library(here) 33 | library(usethis) 34 | library(pkgdown) 35 | # options(rmarkdown.html_vignette.check_title = FALSE) 36 | 37 | # git rm -r --cached . 38 | options(rmarkdown.html_vignette.check_title = FALSE) 39 | # pkgdown::build_favicons() 40 | devtools::build_vignettes() 41 | usethis::use_pkgdown(config_file = "./pkgdown/_pkgdown.yml") 42 | 43 | .rs.restartR() 44 | 45 | pkgdown::build_site(pkg = here::here()) 46 | # usethis::use_github_action("pkgdown") 47 | 48 | # usethis::use_github_pages(branch = "main", path = "/docs", cname = NA) 49 | 50 | # template: 51 | # params: 52 | # bootswatch: sandstone 53 | 54 | ########### Submit to CRAN ############ 55 | 56 | # devtools::check() # add the console output to cran-commentes.md 57 | # devtools::check_rhub() # check that your email is 'validated.' You'll need a token emailed to you 58 | # devtools::check_win_devel() 59 | # devtools::release() 60 | 61 | ##########build a vignette######### 62 | 63 | # usethis::use_vignette("A_buildReport-test") 64 | # usethis::use_vignette("ScriptLayout") 65 | # usethis::use_vignette("ExampleRunFile") 66 | # usethis::use_vignette("InitialSetUp") 67 | 68 | #########NOTES######### 69 | 70 | # bootstrap shiny design 71 | # https://gallery.shinyapps.io/117-shinythemes/ 72 | 73 | # Guide for checking CMD CHECK() 74 | # https://r-pkgs.org/r-cmd-check.html 75 | 76 | # loading qpdf: 77 | # https://stackoverflow.com/questions/41570633/how-to-build-qpdf-on-windows 78 | # https://stackoverflow.com/questions/15035150/r-cmd-check-as-cran-warning 79 | # https://sourceforge.net/projects/qpdf/files/qpdf/10.0.1/ 80 | # Sys.setenv('PATH' = paste0('C:/Program Files/qpdf-10.0.1/bin;', Sys.getenv('PATH'))) 81 | # Sys.which(Sys.getenv("R_QPDF", "qpdf")) 82 | 83 | # Compress Files 84 | # https://stackoverflow.com/questions/10233593/how-to-effectively-deal-with-uncompressed-saves-during-package-check 85 | # save(land, file="./data/sysdata.rda", compress='xz') 86 | 87 | # Add a favicon 88 | # https://github.com/r-lib/pkgdown/issues/379 89 | 90 | # Licence 91 | # https://stackoverflow.com/questions/56102225/r-devtoolscheck-license-is-not-mentioned-and-other-issues-in-description-file 92 | 93 | # Dealing with "no visible binding for global variable '*'" 94 | # https://stackoverflow.com/questions/9439256/how-can-i-handle-r-cmd-check-no-visible-binding-for-global-variable-notes-when 95 | 96 | # clean up gitignore 97 | # https://stackoverflow.com/questions/48955103/non-standard-file-directory-found-at-top-level-readme-rmd-persists-even-after 98 | 99 | # Make code citable 100 | # https://guides.github.com/activities/citable-code/ 101 | 102 | # General Reference 103 | # https://github.com/timjmiller/wham/blob/master/DESCRIPTION 104 | # date: "`r format(Sys.Date(), format='%B %d %Y') `" 105 | 106 | #https://github.com/r-lib/pkgdown/issues/379 107 | 108 | 109 | 110 | ######## OLD STUFF ############# 111 | 112 | #'Replace the first value, if missing, with the next nearest value. 113 | #' 114 | #' If the first value of the timeseries of this column (c) is 0/NaN/NA. Change the first value (and subsequent 0/NaN/NA values) to the first available non-0/NaN/NA value. Then, used in before with 'ReplaceMid'. 115 | #' @param colnames Names of columns to apply this action to. 116 | #' @param temp Name of dataset to apply this action to. 117 | #' @keywords Replace, First 118 | #' @export 119 | #' @examples 120 | #' ReplaceFirst() 121 | ReplaceFirst <- function(colnames, temp) { 122 | for (c0 in 1:length(colnames)) { 123 | if (temp[1, colnames[c0]] %in% c(0, NA, NaN, NULL)) { 124 | findfirstvalue <- 125 | temp[which(!(temp[, colnames[c0]] %in% c(0, NA, NaN, NULL))), 126 | colnames[c0]][1] 127 | temp[1, colnames[c0]] <- findfirstvalue 128 | } 129 | } 130 | return(temp) 131 | } 132 | 133 | 134 | #'Replace the first value, if missing, with the next nearest value. 135 | #' 136 | #' If a middle value of the timeseries of this column (c) is 0/NaN/NA. Change the currently 0/NaN/NA value to the previous available non-0/NaN/NA value. Then, used after with 'ReplaceFirst'. 137 | #' @param colnames Names of columns to apply this action to. 138 | #' @param temp Name of dataset to apply this action to. 139 | #' @keywords Replace, Mid, Middle 140 | #' @export 141 | #' @examples 142 | #' ReplaceMid() 143 | ReplaceMid <- function(colnames, temp) { 144 | for (c0 in 1:length(colnames)) { 145 | #If a middle value of the timeseries of this column (c) is 0/NaN/NA 146 | #Change the currently 0/NaN/NA value to the previous available non-0/NaN/NA value 147 | if (sum(temp[, colnames[c0]] %in% c(0, NA, NaN, NULL)) > 0) { 148 | troublenumber <- which(temp[, colnames[c0]] %in% c(0, NA, NaN, NULL)) 149 | for (r in 1:length(troublenumber)) { 150 | findlastvalue <- temp[troublenumber[r] - 1, colnames[c0]][1] 151 | temp[troublenumber[r], colnames[c0]] <- findlastvalue 152 | } 153 | } 154 | } 155 | return(temp) 156 | } 157 | 158 | 159 | -------------------------------------------------------------------------------- /README.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: md_document 3 | --- 4 | 5 | 6 | 7 | ```{r, echo = FALSE, warning=FALSE, message=FALSE} 8 | knitr::opts_chunk$set( 9 | collapse = TRUE, 10 | comment = "#>", 11 | fig.path = "man/figures/", 12 | fig.height = 1 13 | ) 14 | require(ggplot2) 15 | ``` 16 | 17 | ```{r echo=FALSE, results="hide", message=FALSE, include=FALSE} 18 | library("badger", quietly = TRUE) 19 | ``` 20 | 21 | # NMFSReports logo with an image of a NOAA Fisheries report 22 | 23 | 24 | ### *Easily write NOAA reports and Tech Memos in R Markdown* 25 | 26 | 27 | ```{r, echo = FALSE, results='asis', message=FALSE} 28 | cat( 29 | badge_devel("EmilyMarkowitz-NOAA/NMFSReports", "blue"), 30 | badge_lifecycle("maturing", "blue"), 31 | badge_last_commit("EmilyMarkowitz-NOAA/NMFSReports") 32 | ) 33 | ``` 34 | 35 | ## Author 36 | 37 | **Emily Markowitz** (Emily.Markowitz AT noaa.gov) 38 | 39 | Alaska Fisheries Science Center, 40 | 41 | National Marine Fisheries Service, 42 | 43 | National Oceanic and Atmospheric Administration, 44 | 45 | Seattle, WA 98195 46 | 47 | ## Installation 48 | 49 | #### `NMFSReports` 50 | 51 | Learn more about this package at this [pkgdown webpage!](https://emilymarkowitz-noaa.github.io/NMFSReports/) 52 | 53 | The NMFSReports Package has all of the basic architecture you need to create reproducible and repeatable NOAA Tech Memos in R Markdown! This approach is perfect for efficiently rolling out annual (or other regular) reports or reports with formulaic sections (the same chapter structure but for a different area or species). Scripts integrate table, figure, data, and bibliography management and design automation. 54 | 55 | 56 | ```{r, eval=FALSE} 57 | library(devtools) 58 | devtools::install_github("EmilyMarkowitz-NOAA/NMFSReports") 59 | library(NMFSReports) 60 | 61 | # Or, alternatively, 62 | remotes::install_github("EmilyMarkowitz-NOAA/NMFSReports@main") 63 | ``` 64 | 65 | #### You may also consider useing this package with `nmfspalette` 66 | 67 | A package for NOAA Fisheries color schemes. More info [here](https://github.com/nmfs-general-modeling-tools/nmfspalette). 68 | 69 | ```{r, eval=FALSE} 70 | library(devtools) 71 | devtools::install_github("nmfs-general-modeling-tools/nmfspalette") 72 | library(nmfspalette) 73 | ``` 74 | 75 | ## Notes 76 | 77 | More details about how to use the [https://github.com/RVerse-Tutorials/GoogleDrive1]({googledrive} R pakage) in RMarkdown Documents: 78 | 79 | 80 | ## Conference Presentations 81 | 82 | Markowitz, EH. Reproducible Reports in R Markdown - Perspectives and {NMFSReports}. R Cascadia Conf., June 2021. Remote. ([Slides](https://github.com/EmilyMarkowitz-NOAA/NMFSReports/blob/main/presentations/2021-06-05NMFSReports-RCascadiaConf.pdf), [Recording of Presentation](https://www.youtube.com/watch?v=zNKdQ6jvr-M&list=PLzwtsyfF_Z4pPszfwklTD66AWUuMwS7qw&index=11)) 83 | 84 | Markowitz, EH. Reproducible National-level Reports: Using RMarkdown to Recode the Fisheries Economics of the US Report. 85 | 86 | - Women in Statistics and Data Science Conf.; American Statistical Association, September 2020. Remote. 87 | - American Fisheries Society, September 2020. Remote. 88 | - SatRDay Conference, March 2020. Washington, D.C./Remote. ([Recording](https://youtu.be/-mycRwaC60A)) 89 | 90 | ## Abstract 91 | 92 | Scientists in government and beyond are often tasked with preparing analysis-driven reports that inform policy and are crucial for documenting the state of their programs at regular intervals (e.g., annually, quarterly, monthly). Although these reports typically follow the same format for each iteration, updating content with new data from previous document line by line can lead to inefficient writing and introduce errors. 93 | 94 | Alternatively, R and R Markdown can be used to systematically modernize report creation. To address this need within our agency I have developed a new R package, `{NMFSReports}`, which uses R and R Markdown to provide an analysis-to-product approach to report writing by centralizing back-end data analyses and efficiently streamlining copy-edit and design sub-processes. The `{NMFSReports}` R package first creates the basic report outline and folder architecture to create reproducible reports, and then provides users with grammar and organization helper functions that assist in report writing. To aid in the final publication process, this workflow can also be used to produce intermediate output files for subject matter experts and collaborators to review and use. `{NMFSReports}` can produce copy-edit ready and accessibility-compliant documents for editors, style guide-formatted and flow-in ready text (including bibliography, footnote, figure, and table management) for authors, tables and figures for graphic designers, and web-ready data files for web tool developers. Though this package is in early stages of development, it is already clear it has the potential to save colleagues across our agency countless hours and improve efficiency and consistency among our teams and offices. Though developed for reports produced by scientists at NOAA Fisheries, the concepts and structures behind `{NMFSReports}` have utility for anyone seeking to streamline reports, graphics, and web tools. 95 | 96 | ## NOAA README 97 | 98 | This repository is a scientific product and is not official communication of the National Oceanic and Atmospheric Administration, or the United States Department of Commerce. All NOAA GitHub project code is provided on an ‘as is’ basis and the user assumes responsibility for its use. Any claims against the Department of Commerce or Department of Commerce bureaus stemming from the use of this GitHub project will be governed by all applicable Federal law. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by the Department of Commerce. The Department of Commerce seal and logo, or the seal and logo of a DOC bureau, shall not be used in any manner to imply endorsement of any commercial product or activity by DOC or the United States Government. 99 | 100 | ## NOAA License 101 | 102 | Software code created by U.S. Government employees is not subject to copyright in the United States (17 U.S.C. §105). The United States/Department of Commerce reserve all rights to seek and obtain copyright protection in countries other than the United States for Software authored in its entirety by the Department of Commerce. To this end, the Department of Commerce hereby grants to Recipient a royalty-free, nonexclusive license to use, copy, and create derivative works of the Software outside of the United States. 103 | 104 | 105 | NOAA Fisheries 106 | 107 | [U.S. Department of Commerce](https://www.commerce.gov/) | [National Oceanographic and Atmospheric Administration](https://www.noaa.gov) | [NOAA Fisheries](https://www.fisheries.noaa.gov/) 108 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # **This repo has now been ARCHIVED AND DEPRECIATED.** Only use this repository for reference. 4 | 5 | # NMFSReports logo with an image of a NOAA Fisheries report 6 | 7 | ### *Easily write NOAA reports and Tech Memos in R Markdown* 8 | 9 | [![](https://img.shields.io/badge/devel%20version-0.0.1.1-blue.svg)](https://github.com/EmilyMarkowitz-NOAA/NMFSReports) 10 | [![](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing) 11 | [![](https://img.shields.io/github/last-commit/EmilyMarkowitz-NOAA/NMFSReports.svg)](https://github.com/EmilyMarkowitz-NOAA/NMFSReports/commits/master) 12 | 13 | ## Author 14 | 15 | **Emily Markowitz** (Emily.Markowitz AT noaa.gov) 16 | 17 | Alaska Fisheries Science Center, 18 | 19 | National Marine Fisheries Service, 20 | 21 | National Oceanic and Atmospheric Administration, 22 | 23 | Seattle, WA 98195 24 | 25 | ## Installation 26 | 27 | #### `NMFSReports` 28 | 29 | Learn more about this package at this [pkgdown 30 | webpage!](https://emilymarkowitz-noaa.github.io/NMFSReports/) 31 | 32 | The NMFSReports Package has all of the basic architecture you need to 33 | create reproducible and repeatable NOAA Tech Memos in R Markdown! This 34 | approach is perfect for efficiently rolling out annual (or other 35 | regular) reports or reports with formulaic sections (the same chapter 36 | structure but for a different area or species). Scripts integrate table, 37 | figure, data, and bibliography management and design automation. 38 | 39 | library(devtools) 40 | devtools::install_github("EmilyMarkowitz-NOAA/NMFSReports") 41 | library(NMFSReports) 42 | 43 | # Or, alternatively, 44 | remotes::install_github("EmilyMarkowitz-NOAA/NMFSReports@main") 45 | 46 | #### You may also consider useing this package with `nmfspalette` 47 | 48 | A package for NOAA Fisheries color schemes. More info 49 | [here](https://github.com/nmfs-general-modeling-tools/nmfspalette). 50 | 51 | library(devtools) 52 | devtools::install_github("nmfs-general-modeling-tools/nmfspalette") 53 | library(nmfspalette) 54 | 55 | ## Notes 56 | 57 | More details about how to use the 58 | [https://github.com/RVerse-Tutorials/GoogleDrive1](%7Bgoogledrive%7D%20R%20pakage) 59 | in RMarkdown Documents: 60 | 61 | ## Conference Presentations 62 | 63 | Markowitz, EH. Reproducible Reports in R Markdown - Perspectives and 64 | {NMFSReports}. R Cascadia Conf., June 2021. Remote. 65 | ([Slides](https://github.com/EmilyMarkowitz-NOAA/NMFSReports/blob/main/presentations/2021-06-05NMFSReports-RCascadiaConf.pdf), 66 | [Recording of 67 | Presentation](https://www.youtube.com/watch?v=zNKdQ6jvr-M&list=PLzwtsyfF_Z4pPszfwklTD66AWUuMwS7qw&index=11)) 68 | 69 | Markowitz, EH. Reproducible National-level Reports: Using RMarkdown to 70 | Recode the Fisheries Economics of the US Report. 71 | 72 | - Women in Statistics and Data Science Conf.; American Statistical 73 | Association, September 2020. Remote. 74 | - American Fisheries Society, September 2020. Remote. 75 | - SatRDay Conference, March 2020. Washington, D.C./Remote. 76 | ([Recording](https://youtu.be/-mycRwaC60A)) 77 | 78 | ## Abstract 79 | 80 | Scientists in government and beyond are often tasked with preparing 81 | analysis-driven reports that inform policy and are crucial for 82 | documenting the state of their programs at regular intervals (e.g., 83 | annually, quarterly, monthly). Although these reports typically follow 84 | the same format for each iteration, updating content with new data from 85 | previous document line by line can lead to inefficient writing and 86 | introduce errors. 87 | 88 | Alternatively, R and R Markdown can be used to systematically modernize 89 | report creation. To address this need within our agency I have developed 90 | a new R package, `{NMFSReports}`, which uses R and R Markdown to provide 91 | an analysis-to-product approach to report writing by centralizing 92 | back-end data analyses and efficiently streamlining copy-edit and design 93 | sub-processes. The `{NMFSReports}` R package first creates the basic 94 | report outline and folder architecture to create reproducible reports, 95 | and then provides users with grammar and organization helper functions 96 | that assist in report writing. To aid in the final publication process, 97 | this workflow can also be used to produce intermediate output files for 98 | subject matter experts and collaborators to review and use. 99 | `{NMFSReports}` can produce copy-edit ready and accessibility-compliant 100 | documents for editors, style guide-formatted and flow-in ready text 101 | (including bibliography, footnote, figure, and table management) for 102 | authors, tables and figures for graphic designers, and web-ready data 103 | files for web tool developers. Though this package is in early stages of 104 | development, it is already clear it has the potential to save colleagues 105 | across our agency countless hours and improve efficiency and consistency 106 | among our teams and offices. Though developed for reports produced by 107 | scientists at NOAA Fisheries, the concepts and structures behind 108 | `{NMFSReports}` have utility for anyone seeking to streamline reports, 109 | graphics, and web tools. 110 | 111 | ## NOAA README 112 | 113 | This repository is a scientific product and is not official 114 | communication of the National Oceanic and Atmospheric Administration, or 115 | the United States Department of Commerce. All NOAA GitHub project code 116 | is provided on an ‘as is’ basis and the user assumes responsibility for 117 | its use. Any claims against the Department of Commerce or Department of 118 | Commerce bureaus stemming from the use of this GitHub project will be 119 | governed by all applicable Federal law. Any reference to specific 120 | commercial products, processes, or services by service mark, trademark, 121 | manufacturer, or otherwise, does not constitute or imply their 122 | endorsement, recommendation or favoring by the Department of Commerce. 123 | The Department of Commerce seal and logo, or the seal and logo of a DOC 124 | bureau, shall not be used in any manner to imply endorsement of any 125 | commercial product or activity by DOC or the United States Government. 126 | 127 | ## NOAA License 128 | 129 | Software code created by U.S. Government employees is not subject to 130 | copyright in the United States (17 U.S.C. §105). The United 131 | States/Department of Commerce reserve all rights to seek and obtain 132 | copyright protection in countries other than the United States for 133 | Software authored in its entirety by the Department of Commerce. To this 134 | end, the Department of Commerce hereby grants to Recipient a 135 | royalty-free, nonexclusive license to use, copy, and create derivative 136 | works of the Software outside of the United States. 137 | 138 | NOAA Fisheries 139 | 140 | [U.S. Department of Commerce](https://www.commerce.gov/) | [National 141 | Oceanographic and Atmospheric Administration](https://www.noaa.gov) | 142 | [NOAA Fisheries](https://www.fisheries.noaa.gov/) 143 | -------------------------------------------------------------------------------- /docs/LICENSE-text.html: -------------------------------------------------------------------------------- 1 | 2 | License • NMFSReports 6 | 7 | 8 |
    9 |
    93 | 94 | 95 | 96 |
    97 |
    98 | 101 | 102 |
    YEAR: 2021
    103 | COPYRIGHT HOLDER: Emily Markowitz
    104 | 
    105 | 106 |
    107 | 108 | 111 | 112 |
    113 | 114 | 115 | 116 |
    119 | 120 |
    121 |

    Site built with pkgdown 2.0.5.

    122 |
    123 | 124 |
    125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /vignettes/csl.csl: -------------------------------------------------------------------------------- 1 | 2 | 210 | -------------------------------------------------------------------------------- /docs/reference/CreateMetadata.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Record Metadata — CreateMetadata • NMFSReports 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
    63 |
    64 | 142 | 143 | 144 | 145 |
    146 | 147 |
    148 |
    149 | 154 | 155 |
    156 |

    Record Metadata

    157 |
    158 | 159 |
    CreateMetadata(dir_out = ".", title = "My Project")
    160 | 161 |

    Arguments

    162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 |
    dir_out

    Path file will be saved to.

    title

    Title of file.

    173 | 174 | 175 |
    176 | 181 |
    182 | 183 | 184 |
    185 | 188 | 189 |
    190 |

    Site built with pkgdown 1.6.1.

    191 |
    192 | 193 |
    194 |
    195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | -------------------------------------------------------------------------------- /docs/news/index.html: -------------------------------------------------------------------------------- 1 | 2 | Changelog • NMFSReports 6 | 7 | 8 |
    9 |
    93 | 94 | 95 | 96 |
    97 |
    98 | 102 | 103 |
    104 | 105 |
    • Added a NEWS.md file to track changes to the package.
    • 106 |
    107 |
    108 | 109 | 112 | 113 |
    114 | 115 | 116 |
    119 | 120 |
    121 |

    Site built with pkgdown 2.0.5.

    122 |
    123 | 124 |
    125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /docs/articles/index.html: -------------------------------------------------------------------------------- 1 | 2 | Articles • NMFSReports 6 | 7 | 8 |
    9 |
    93 | 94 | 95 | 96 |
    97 |
    98 | 101 | 102 |
    103 |

    NMFS Reports Vignettes

    104 |

    These vignettes provide an introduction to how to rewite reports using the NMFSReports package.

    105 | 106 |
    Use buildReport() to begin writing your report
    107 |
    108 |
    How to use the run.R file to be the skeleton of your report
    109 |
    110 |
    Functions and examples to help you write your report
    111 |
    112 |
    System and packages used to build NMFSReports
    113 |
    114 |
    115 |
    116 |
    117 | 118 | 119 |
    128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | --------------------------------------------------------------------------------