
2. Create a Research Project with Quarto and rUM
Source:vignettes/OO2_make_research_project.Rmd
OO2_make_research_project.Rmd
Introduction
This is a collection of document templates, available through R, from your friends at the University of Miami (UM).
The rUM
package will help you create research
manuscripts by removing the configuration hassles commonly encountered
when learning to write papers using R. rUM
will initialize
a new RStudio project and a Quarto file that includes the outline for a
research paper. The Quarto file comes preconfigured with a YAML header
(don’t worry if you don’t know what that means yet) with code chunks to
load the tidyverse
and conflicted
packages.
Manuscript sections have been created for Introduction, Methods,
Results, Conclusion, and References. The project also includes a
.gitignore
file which is designed to help protect against
accidentally leaking data when using git with websites like www.github.com.
rUM’s documentation can be found here:
How do I get quarto
and rUM
? (Add a “quart
o’ rUM
”!)
Modern version RStudio (v2022.07 or later) ships with Quarto but you can install the latest version of Quarto from here.
-
Add
rUM
to your computer by:- using RStudio: click on the Packages tab in the bottom right windowpane, click the Install button, type rUM, and click Install.
- downloading rUM from CRAN and installing it by running this code in R console:
install.packages("rUM")
- downloading the latest version of rUM from GitHub by running commands into the R console:
if (!requireNamespace("remotes")) install.packages("remotes") remotes::install_github("RaymondBalise/rUM")
Use
rUM
by running this in the console of RStudio:
Ordering rUM
from the Menu
To create a research project that uses rUM
, follow these
steps. This will initialize a new RStudio project that has an analysis.qmd
Quarto
file using the tidyverse
and conflicted
packages and some other useful files which are described below.
Using the RStudio menus, choose: File > New Project > New Directory
-
Scroll down and then select
rUM
Research Project Template -
Specify the location of where your research project will be saved
Add rUM
into an existing folder/directory that does not
have an RStudio project.
What if you have already created a folder containing the important
files for your project? Create a new project in your existing folder!
This will now be your project directory (complete with a
.Rproj
file).
Navigate to File > New Project > Existing Directory
-
Specify the location of where your research project will be saved
Run the following script in your console:
# Change the text inside the quotes on the next line to indicate the path to your folder/directory.
PATH <- "~/Documents/blah"
make_project(PATH, type = "Quarto (analysis.qmd)")
What is in the project? (What is served with your
rUM
?)
A new project directory is created and it will be populated with these files:
- An aggressive
.gitignore
to help prevent the unintended sharing of sensitive study information or protected health information (PHI). -
analysis.qmd
is a Quarto template for writing your research project. It has a preconfigured YAML header; Introduction, Methods, Results, Conclusion, and Reference sections; and a code chunk to construct your bibliography usingknitr::write_bib()
. - A
README.md
template containing structured sections for comprehensive project documentation, including study details, setup instructions, and file descriptions. - A
dated_progress_notes.md
file that automatically tracks project milestones, starting with the project creation date. - An empty folder named
data
. This folder is listed within the.gitignore
. That means that git should not track these files. This should help prevent data leakage but be sure to talk to a data security expert before sharing any biomedical projects on websites like GitHub. - A
.Rproj
file with the same name as your project folder. - Two text files,
packages.bib
andreferences.bib
, which are used to hold details for your paper’s bibliography. Refer to the Methods and References sections, respectively, within theanalysis.qmd
file for initial examples of how to add/use references. -
the-new-england-journal-of-medicine.csl
is the citation style language (CSL) based on the New England Journal of Medicine requirements. -
apa.csl
is the citation style language (CSL) based on the American Psychological Association 7th edition requirements. -
Quarto only:
custom.scss
provides styling customization options for your Quarto document. Additional style sheets can be added usingwrite_scss()
.
Newly created files:
analysis.qmd
:
Session
If you are new to R, ignore this.
sessionInfo()
#> R version 4.4.3 (2025-02-28)
#> Platform: aarch64-apple-darwin20
#> Running under: macOS Sequoia 15.3.1
#>
#> Matrix products: default
#> BLAS: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRblas.0.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/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] digest_0.6.37 desc_1.4.3 R6_2.5.1 fastmap_1.2.0
#> [5] xfun_0.50 cachem_1.1.0 knitr_1.49 htmltools_0.5.8.1
#> [9] rmarkdown_2.29 lifecycle_1.0.4 cli_3.6.3 sass_0.4.9
#> [13] pkgdown_2.1.1 textshaping_1.0.0 jquerylib_0.1.4 systemfonts_1.2.1
#> [17] compiler_4.4.3 rstudioapi_0.17.1 tools_4.4.3 ragg_1.3.3
#> [21] bslib_0.9.0 evaluate_1.0.3 yaml_2.3.10 jsonlite_1.9.1
#> [25] rlang_1.1.4 fs_1.6.5 htmlwidgets_1.6.4