Reproducible Analytical Pipelines

Alice Hannah

Data Innovation Team, Scottish Government

24 September 2025

Is RAP relevant to me?

  • Would it be a nightmare to have to go back and rerun your data project from the beginning if you found a mistake?

  • Do you have to make a lot of manual edits to code before each run?

  • Is there a lot of repetition in your code?

  • Would a new person find it difficult to understand?

What is RAP?

  • An overall approach to analysis

  • A RAP will:

    • Improve the quality of the analysis
    • Increase trust in the analysis by producers, their managers and users
    • Create a more efficient process
    • Improve business continuity and knowledge management

RAP principles


  1. Minimise manual steps
  1. Be built using open-source software; e.g. R, Python
  1. Be peer reviewed by colleagues
  1. Be version controlled; e.g. Git
  1. Be open to anyone; e.g. code published on GitHub
  1. Follow good practice for quality assurance
  1. Contain well-commented code and have documentation embedded

Self-assessment tool

  • Scottish Government RAP Self-Assessment Tool

  • Criteria categorised into 4 ‘levels’: Aspiring, Fundamental, Intermediate and Advanced.

  • Description and links to further resources for each criteria.

  • Complete form and download report to track progress and inform next steps.

Example criteria

Aspiring RAP Repository self-contained and
well-structured


Intermediate RAP Functions used where appropriate

Fundamental RAP Code follows a style guide



Advanced RAP Functions have unit tests

Top tips

  • Start small and iterate (Agile project development helps here!)

  • Share what you are doing and learn from others around you

  • Find a critical friend who is willing to review your project

  • Use an issues log to keep track and plan future improvements