Executable compenium template
Closed this issue · 8 comments
Following up this discussion, a usethis style compendium could be considered.
But, there are so many compendium formats available. We need to think about interoperability rather than XKCD 927.
R specific
- https://github.com/ropensci/rrrpkg
- https://github.com/benmarwick/rrtools paper
- https://github.com/FRBCesab/rcompendium/
- https://github.com/Pakillo/template
- https://github.com/jhollist/manuscriptPackage
- https://cran.r-project.org/web/packages/ProjectTemplate/
Sweave
- https://journal.r-project.org/archive/2011/RJ-2011-013/RJ-2011-013.pdf
- https://www.klinikum.uni-heidelberg.de/fileadmin/inst_med_biometrie/pdf/compHuang.pdf
Not R specific but can also be used to run R
(white)papers
How about we just use the structure of Turing (rather than inventing something new):
compendium/
├── CITATION
├── code
│ ├── analyse_data.R
│ └── clean_data.R
├── data_clean
│ └── data_clean.csv
├── data_raw
│ ├── datapackage.json
│ └── data_raw.csv
├── Dockerfile
├── figures
│ └── flow_chart.jpeg
├── LICENSE
├── Makefile
├── paper.Rmd
└── README.md
It means that:
- We copy the
materials_dir
(assume that it containsdata_*
,code
andpaper.Rmd
) as theoutput_dir
. - Place
Dockerfile
- Create a directory called
rang
(or even./inst/rang
) and putcache
(ifcache
isTRUE
) andrang.R
there. - In the
Dockerfile
, justCOPY * /*
- Rewire the current
Dockerfile
toRUN rang/rang.R
- Rewire
cache
torang/cache
inrang/rang.R
I was comparing the compendiums the other day and I also like the Turing way best. Lets go with that one.
Maybe inst/rang
is a better idea because we can also cover rrtools
. We can just have a function called rang::use_rang()
to insert our rang
things into a format-independent existing compendium directory. We can also provide a function called rang::use_turing()
to generate a basic structure.
Potential features / issues
-
Makefile
detection to insertmake
as asysreqs
- How about
rrtools
' Quarto? - Is this real?
I like the use_* approach. eventually one could also implement other compendiums like this. Can you help me understand the "is this real" comment. Is that a GHA to build a docker image?
Quote from the readme
this also creates creates a minimal .yml configuration file to activate continuous integration using GitHub Actions. This will attempt to render your qmd document, in a Docker container specified by your Dockerfile, each time you push to GitHub.
With this default Dockerfile
Too good to be true, e.g. no installation of Quarto CLI. But well, it says "attempt".
oh ok that would be something :-O
Tasks
-
use_rang
-
use_turing
create_turing
- A vignette
- Integration of apptainer
- Don't use
...
increate_turing