diff --git a/docs/404.html b/docs/404.html index c8f5cce9..29fc2ac8 100644 --- a/docs/404.html +++ b/docs/404.html @@ -12,7 +12,7 @@ - + @@ -39,7 +39,7 @@
@@ -64,6 +64,12 @@If you are new to R, ignore this.
sessionInfo()
-#> R version 4.2.2 (2022-10-31)
-#> Platform: x86_64-apple-darwin17.0 (64-bit)
-#> Running under: macOS Big Sur ... 10.16
+#> R version 4.4.0 (2024-04-24)
+#> Platform: x86_64-apple-darwin20
+#> Running under: macOS Monterey 12.7.5
#>
#> Matrix products: default
-#> BLAS: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
-#> LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
+#> BLAS: /Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/lib/libRblas.0.dylib
+#> LAPACK: /Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.0
#>
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#>
+#> time zone: America/New_York
+#> tzcode source: internal
+#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> loaded via a namespace (and not attached):
-#> [1] rstudioapi_0.14 knitr_1.42 magrittr_2.0.3 R6_2.5.1
-#> [5] ragg_1.2.5 rlang_1.0.6 fastmap_1.1.0 stringr_1.5.0
-#> [9] tools_4.2.2 xfun_0.37 cli_3.6.0 jquerylib_0.1.4
-#> [13] systemfonts_1.0.4 htmltools_0.5.4 yaml_2.3.7 digest_0.6.31
-#> [17] rprojroot_2.0.3 lifecycle_1.0.3 pkgdown_2.0.7 textshaping_0.3.6
-#> [21] purrr_1.0.1 sass_0.4.5 vctrs_0.5.2 fs_1.6.1
-#> [25] memoise_2.0.1 glue_1.6.2 cachem_1.0.6 evaluate_0.20
-#> [29] rmarkdown_2.20 stringi_1.7.12 compiler_4.2.2 bslib_0.4.2
-#> [33] desc_1.4.2 jsonlite_1.8.4
If you are new to R, ignore this.
sessionInfo()
-#> R version 4.2.2 (2022-10-31)
-#> Platform: x86_64-apple-darwin17.0 (64-bit)
-#> Running under: macOS Big Sur ... 10.16
+#> R version 4.4.0 (2024-04-24)
+#> Platform: x86_64-apple-darwin20
+#> Running under: macOS Monterey 12.7.5
#>
#> Matrix products: default
-#> BLAS: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
-#> LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
+#> BLAS: /Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/lib/libRblas.0.dylib
+#> LAPACK: /Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.0
#>
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#>
+#> time zone: America/New_York
+#> tzcode source: internal
+#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> loaded via a namespace (and not attached):
-#> [1] rstudioapi_0.14 knitr_1.42 magrittr_2.0.3 R6_2.5.1
-#> [5] ragg_1.2.5 rlang_1.0.6 fastmap_1.1.0 stringr_1.5.0
-#> [9] tools_4.2.2 xfun_0.37 cli_3.6.0 jquerylib_0.1.4
-#> [13] systemfonts_1.0.4 htmltools_0.5.4 yaml_2.3.7 digest_0.6.31
-#> [17] rprojroot_2.0.3 lifecycle_1.0.3 pkgdown_2.0.7 textshaping_0.3.6
-#> [21] purrr_1.0.1 sass_0.4.5 vctrs_0.5.2 fs_1.6.1
-#> [25] memoise_2.0.1 glue_1.6.2 cachem_1.0.6 evaluate_0.20
-#> [29] rmarkdown_2.20 stringi_1.7.12 compiler_4.2.2 bslib_0.4.2
-#> [33] desc_1.4.2 jsonlite_1.8.4
Site built with pkgdown 2.0.7.
+Site built with pkgdown 2.0.9.
diff --git a/docs/articles/O4_make_a_package.html b/docs/articles/O4_make_a_package.html new file mode 100644 index 00000000..6c53c87a --- /dev/null +++ b/docs/articles/O4_make_a_package.html @@ -0,0 +1,202 @@ + + + + + + + +Saving your data and analyses into an R package helps to create
+reproducible research. Someone who wants to reproduce your work can load
+a package to have access to your data and your paper(s).
+rUM
can help you by creating a project
+that has all the files/directories needed for an R package including a
+vignette folder that contains the outline of a paper.
All you need to do is add vignette = TRUE
when you use
+the make_project()
function. Once the project is created,
+run the run_me.R file. For example type:
rUM::make_project("~/Desktop/my.example", "R", example = TRUE, vignette = TRUE)
.
+This creates a new project with all the files for a package in the
+current directory. The vignette includes an example table and figure and
+all the R Markdown syntax for adding hyperlinks to the table and
+figures.source("RUN_ME_FIRST.R")
into the RStudio IDE
+console and then pressing enter. If you are working in RStudio it will
+ask you if it can/should close windows for two deleted files. Say
+Yes. They are a couple temporary files that we used to
+set options the project.usethis::use_proprietary_license("Your Name Goes Here")
. To
+learn more about licences look at the documentation for
+use_proprietary_license()
by typing:
+?usethis::use_proprietary_license
. You can also learn more
+at choosealicense.com or here
+but talk to the legal counsel at your institution/organization before
+making a decision.Yes! When you install rUM
we make sure
+you have a modern version of the R quarto
package but we do
+not install the most modern copy of the Quarto language itself (which
+lives outside of R). You can make sure that your version of Quarto is
+modern enough by running quarto::quarto_version()
. If your
+version is not 1.4.549 or higher, install the latest version of Quarto
+directly from here.
vignettes/O5_show_example.Rmd
+ O5_show_example.Rmd
If you would like to see an example paper, that has code blocks to
+produce a summary table and a graphic, include the
+example = TRUE
argument when you use the
+make_project()
function. For example, if you type
+rUM::make_project("~/Desktop/my.example", "R", example = TRUE)
,
+in the Results section of the paper you will see code
+like:
+#| tbl-cap: |
+#| Your real caption belongs here. Remember that cross references to tables
+#| use labels for the code chunk starting with tbl-.
+
+
+# To learn how to use tbl_summary look at https://www.danieldsjoberg.com/gtsummary/
+analysis |>
+ tbl_summary(
+ include = c(everything()), # choose your variables here
+ # change auto_man to the name of your column variable or delete by = auto_man
+ by = auto_man, # split table by group
+ missing = "no" # don't list missing data separately
+ ) %>%
+ # add_n() %>% # add column with total number of non-missing observations
+ # add_p() %>% # test for a difference between groups
+ modify_header(label = "") %>% # update the column header to be blank
+ bold_labels()
and
+
+
+#| fig-cap: |
+#| Your real caption belongs here. Remember that cross references to figures
+#| use labels for the code chunk starting with fig-.
+
+# To learn how to use ggplot start here: https://ggplot2.tidyverse.org/#learning-ggplot2
+analysis |>
+ ggplot() +
+ labs(
+ title = "Your short title goes here.",
+ caption = "Your data sources/citation goes here."
+ ) +
+ geom_blank()
+ # remove geom_blank() and add details here
You will also notice that there are sentences, which begin with “As +can be seen in” that contain cross-reference hyperlinks to the tables +and figures.
+The example table is created using a package called
+gtsummary
. It makes completely customizable, beautiful,
+summary tables which support hyperlinks/cross-references in the
+sentences you write in your paper.
A simpler option is to use the table1()
function from
+the table1
package. It makes excellent tables with nearly
+no typing. If you would like to try it, paste the code below into the
+tbl-table1
code chunk. Unfortunately table1
+does not have good support for hyperlinks/cross-references from your
+writing/prose.
Balise R, Odom G, Grealis K, Cardozo F (2023). +
Balise R, Odom G, Grealis K, Cardozo F (2024). rUM: R Templates from the University of Miami. -https://raymondbalise.github.io/rUM/, -https://github.com/RaymondBalise/rUM. +R package version 2.0.0, +https://github.com/RaymondBalise/rUM, https://raymondbalise.github.io/rUM/.
@Manual{, title = {rUM: R Templates from the University of Miami}, author = {Raymond Balise and Gabriel Odom and Kyle Grealis and Francisco Cardozo}, - year = {2023}, - note = {https://raymondbalise.github.io/rUM/, + year = {2024}, + note = {R package version 2.0.0, https://github.com/RaymondBalise/rUM}, + url = {https://raymondbalise.github.io/rUM/}, }
example
argument to make_project()
+vignette
argument to make_project()
+options(dplyr.summarise.inform=F)
everywhere.Site built with pkgdown 2.0.7.
+Site built with pkgdown 2.0.9.
Choose between "Quarto (analysis.qmd)" or "R Markdown (analysis.Rmd)"
Will the analysis file include an example table/figure?
Will the analysis file be saved as a package vignette?
Will an existing RStudio project be overwritten? This is +needed for for Posit.Cloud. You will be prompted to confirm this option.
Should this new project be opened in a new RStudio
+window? Defaults to TRUE
. NOTE: this option exists to prevent
+RStudio from opening two duplicate versions of the new project when
+this function is executed from RStudio menus. MODIFY WITH CAUTION.
if (FALSE) {
- make_project(path = "~/test_project", type = "Quarto (analysis.qmd)")
-}
-if (FALSE) {
- make_project(path = "~/test_project", type = "R Markdown (analysis.Rmd)")
+ # This makes a project with an example Quarto paper in the project's folder.
+ make_project(path = "~/test", type = "Quarto (analysis.qmd)", example = TRUE, vignette = TRUE)
+ # make_project() allows abbreviations on the project type: "Q" for Quarto or "R" for R Markdown
+ make_project(path = "~/test_project", "Q", TRUE, TRUE)
+
+ # This makes a project with an example R Markdown paper in the project's folder.
+ make_project(path = "~/test", type = "R Markdown (analysis.Rmd)", example = TRUE, vignette = TRUE)
+ # This makes a project with an example paper in the project's folder.
+ make_project(path = "~/test_project", "R", example = TRUE)
}
This holds some r markdown and quarto templates and a template to create a research project in "R Studio".
+Useful links: