Project Directory Structure

Author

Gabriel I. Cook

Introduction

For your project, you will be creating a website. Importantly, you must keep our files organized and easily accessible. A well-structured directory helps us to collaborate efficiently, reduce errors, and facilitate project maintenance. Let’s explore the purpose of each directory in our project structure.

R Studio Project Files

  • <projectname>.Rproj (should match your R Studio Directory and your GitHub Repository Name)

Project Directory Structure

.
├── .git
├── .gitignore
├── .nojekyll
├── .quarto
├── about.qmd
├── api/
│   └── call_apis.R <-------------------------------------
├── blog/
│   ├── _metadata.yml
│   ├── index.qmd
│   └── posts/
├── figs/
├── fonts/
│   └── fontawesome.html
├── images/
│   ├── icons/
│   ├── random_png.png
│   └── profile.jpg
├── index.qmd
├── pages/
│   ├── my_first_page.qmd
│   └── my_second_page.qmd
├── prerender.R  <-------------------------------------------------
├── <projectname>.Rproj
├── robots.txt
└── src/
    ├── data/
    ├── figs/
    ├── functions/
    │   ├── fig_saving.R
    │   ├── fig_theme.R
    │   ├── load_libraries.R
    │   └── view_html.R
    ├── starter_script_file.R
    └── utils/
        └── made-of-code.tmTheme
└── styles/

Configuration Files

These configuration files are stored in the project root (.) directory:

  • .git: contains Git version control system files (do not delete)
  • .gitignore: specifies files and directories that Git should ignore (e.g, your .Renviron, .Rprofile, and other sensitive details) (do not delete)
  • .nojekyll: tells GitHub Pages not to use Jekyll to build the site
  • .quarto: for Quarto-specific configuration files.

Website Files and Directories

  • about.qmd: a website about page (do not delete)
  • docs/: for all rendered website files
  • index.qmd: a website start page (do not delete)
  • pages/: for individual web pages
  • robots.txt: This file specifies how search engines should crawl our site.
  • styles/: for website theme related files

Source Code

The src/ directory contains our project source code:

src/
  data/
  figs/
  functions/
    fig_saving.R
    fig_theme.R
    load_libraries.R
    view_html.R
  starter_script_file.R
  utils/
    made-of-code.tmTheme
  • data/: for data, raw/ and processed/
  • figs/: for .png figures created with {ggplot2} code
  • functions/: reusable functions needed for the project
  • utils/: for project utility files

Figures and Images

The following directories contain figures and image files:

figs/
images/
  icons/
  • figs/: for figures generated by code
  • images/: for image files
  • icons/: for icon files
  • random_png.png and profile.jpg: example files

Brand Directory

brand/
  • brand/: for _brand.yml and related files

Blog Directory

The blog directory contains files related to our project blog:

blog/
  _metadata.yml
  index.qmd
  posts/