This README provides templates and examples for organizing your first data analysis project.
This README provides templates and examples for organizing your first data analysis project.
project-name/
├── data_input/
│ ├── data.csv
│ ├── other_data.csv
│ └── even_more_data.csv
├── R/
│ ├── 01_import_clean.R
│ ├── 02_analysis.R
│ ├── 03_even_more_analysis.R
│ └── 04_figures.R
├── outputs/
│ ├── figures/
│ │ ├── example_plot.png
│ │ ├── example_hist.pdf
│ │ └── example_boxplot.png
│ └── tables/
│ ├── some_output.csv
│ └── some_other.csv
└── report/
├── report.docx
└── references.bib
# R
.Rhistory
.RData
.Rproj.user/
# Python
__pycache__/
*.pyc
.env/
.venv/
# Data
data_input/*
!data_input/README.md
# Outputs
outputs/figures/*
outputs/tables/*
# OS files
.DS_Store
Thumbs.db
# Preamble
### It is suggested to create some type of virtual environment for your project
### before installing any modules. This keeps your project dependencies isolated
# -------- BASIC INFORMATION ---------
# Code Objective: Provide a brief description of the script's purpose.
# Author: Your Name
# Date: YYYY-MM-DD
# ---------- MODULES ----------
import os # this is an example module
# ---------- INPUT DATA ----------
input_file = os.path.join("data", "input.txt")
# ---------- FUNCTIONS ----------
def example_function(file_path):
"""This function reads a file and prints its contents."""
with open(file_path, "r") as file:
content = file.read()
print(content)
# ---------- MAIN SCRIPT ----------
if __name__ == "__main__":
example_function(input_file)
# ---------- END OF SCRIPT ----------
# ---------- DEPENDENCIES ----------
### Create a requirements.txt file listing the modules used in this script
# pip freeze > requirements.txtI was asked to create starter code templates that would help students develop good habits when writing code. The motivation behind this is that when someone new looks at the code, it is easy to read and understand. I was excited to do this, but I also realized that having a complete project structure in mind at the beginning of a project would be helpful for me as well.