Docker Environment for Strong Replication
To ensure a fully reproducible environment, the replication package ships with a Docker workflow that bundles the full R stack, required packages, and JupyterLab.
Recommended: Use Docker whenever you need a clean-room replication or plan to run the notebook on a new machine.
Prebuilt Image
- Registry:
ztshi/plp - Ready for local machines or GitHub Codespaces (install the suggested Jupyter kernel extension when prompted).
Build Locally
docker build -t plp .
Run the Container
docker run --rm -it -p 8888:8888 \
-e JUPYTER_TOKEN=panel-lp \
-v ${PWD}:/home/jovyan/work \
plp
- Wait for the console to print the JupyterLab URL (token or
panel-lp). - Open the URL in a browser.
- Launch
applications/replication.ipynb.
All required R libraries (ggplot2, reshape2, ggpubr, etc.) are baked into the image, so the notebook runs without additional setup.
Troubleshooting
- Port already in use: change
-p 8888:8888to another host port (e.g.,-p 8787:8888). - Permission issues on Windows: ensure Docker Desktop has file-sharing enabled for the repository directory.
- Need persistent tokens: adjust
JUPYTER_TOKENor omit the flag to have Jupyter generate a random token each run.