MPI - Project Management in R

https://hackmd.io/@drmowinckels/2023-11-21-MPI

Share code, ideas and questions

by writing in this document we can have a collaborative document throughout the course.

I have setup a "skeleton" based on the various sections of today to help us be organised.

Introduction

Let's get a little aquianted!
Write in this list your name, your field of study, and your favourite ice-cream flavour.

  • Athanasia Mowinckel - Research Software Engineering - Lemon sorbet
  • Emil Stobbe - Sounds of the Environment, Pistachio
  • Florian Bolenz - Cognitive Psychology - Stracciatella
  • Michael Krause - Research IT - salted caramel
  • Maike Hille - PhD student in Neuroscience - vanilla
  • Anne Klimesch - Clinical Neuroscience - Vegan Almond Magnum
  • Linda Kerbl - Psychology - pistacchio
  • Marlene Hecht - Psychology - Pistachio
  • Moana Beyer - PhD Student in Neuroscience - Pistachio
  • Neele Engelmann - Psychology - Vanilla
  • Lisa Oswald - Political Psychology / Data Science - Pistachio
  • Maike Kleemeyer - RDM - chocolate fudge brownie
  • Annika Werwach - Early cognitive development - Yogurt
  • Stefan Herzog - cognitive science/judgment and decision making - bourbon whiskey pecan
  • Lou Haux - comparative and developmental psychology - yoghurt
  • Elahe Keramati - Philosophy - pistacchio
  • Monalisa Chikezie - Msc student - Cognitive Neuroscience - Vanilla

Add notes from this section here

# Run in R
install.packages(c(
  "remotes",      # installing packages from GitHub
  "rmarkdown",    # rendering reports
  "fs",           # file system operations
  "here",         # navigating paths
  "usethis",      # for course materials
  "tidyverse"     # data-wrangling
))

Exercise

Explore your R installation

install.packages("usethis")
library(usethis)
# saves project on desktop by default for most users
use_course("rstats-wtf/wtf-explore-libraries")
# use_course("rstats-wtf/wtf-explore-libraries", destdir = "my/new/location")
# can alternatively download from 
# https://github.com/rstats-wtf/wtf-explore-libraries

Project Oriented Workflow

Pretty code fonts: monospaced ligatures.
Mo uses Fira Code Retina

https://betterwebtype.com/5-free-monospaced-fonts-with-coding-ligatures/

About R and long file paths

Despite the long path support in Windows [since Win10 1607 from 2016] and efforts like this [changes to R outlined in the post], it will take “at least” very long before one could reliably rely on paths longer than 260 characters on Windows.

https://blog.r-project.org/2023/03/07/path-length-limit-on-windows/

IIUC the changes to R to support long paths on Windows were release with R 4.3.
The corresponding RStudio issue (if that's the IDE used in this case) is still open.

Other developers also suggest that this might also more likley occur on symlinked institutional paths, where the location seems to not be that long, but actually is a pointer to a path that

Python path issues

https://stackoverflow.com/questions/74894455/what-does-error-in-file-existspythonpath-file-name-conversion-problem-na

Exercise

library(usethis)
# saves project on desktop by default for most users
use_course("rstats-wtf/wtf-fix-paths")
# use_course("rstats-wtf/wtf-fix-paths", destdir = "my/new/location")
# can alternatively download from 
# https://github.com/rstats-wtf/wtf-fix-paths

Naming files

Add notes from this section here

Project Structure

Add notes from this section here

Exercise

Create a report that adheres to project organization strategies.

library(usethis)
# saves project on desktop by default for most users
use_course("rstats-wtf/wtf-packages-report")
# use_course("rstats-wtf/wtf-packages-report", destdir = "my/new/location")
# can alternatively download from 
# https://github.com/rstats-wtf/wtf-packages-report

Package Management

Add notes from this section here

Exercise

Explore the changes {renv} makes to a project.

library(usethis)
# saves project on desktop by default for most users
use_course("capro-uio/wtf-explore-renv")
# use_course("capro-uio/wtf-explore-renv", destdir = "my/new/location")
# can alternatively download from 
# https://github.com/capro-uio/wtf-explore-renv

the targets pacakge

https://www.joelnitta.com/posts/2021-11-16_r-bioinfo-flow/

Select a repo