Skip to content

GiuseppeTT/structured

Repository files navigation

structured

Open in Visual Studio Code R-CMD-check lint lifecycle

structured is a tool to create structured R projects. It contains fully documented templates to automate your project creation process.

Useful links

Some useful links:

Installation

Paste these commands in your R console:

install.packages("remotes")
remotes::install_github("GiuseppeTT/structured")

Usage

In RStudio

Follow these steps:

  1. In the top bar, click "File" and then "New Project..."
  2. Select "New Directory"
  3. Scroll down, select either "Basic Structured Project" or "Intermediate Structured Project"
  4. Type a name in "Directory name:" for your project folder
  5. Choose a folder in "Create project as subdirectory of:" to be the parent directory of your project folder
  6. Select one of the project types in "Project type:"
  7. Click "Create Project"

That's it! You can start coding now.

In R console

Modify and paste these commands in your R console:

library(structured)

# path can be either a relative or an absolute path
#
# level must be one of:
# - "Basic"
# - "Intermediate"
#
# type must be one of:
# - "Script"
# - "R Markdown (Simplified)"
# - "R Markdown"
# - "Targets"
# - "Shiny"
# - "None"
#
# if open is TRUE, open the project (if on RStudio) or simply set the working
# directory (if not on RStudio). Else, do nothing.
structure_project(
    path = "cool-project",
    level = "Basic",
    type = "Script",
    open = TRUE
)

That's it! You can start coding now.

Acknowledgements

{structured} was heavily influenced by "set up tools" like the {usethis} R package and the {cookiecutter} python package.