klmr / box

Write reusable, composable and modular R code
https://klmr.me/box/
MIT License
833 stars 47 forks source link

inputting portions of a script #289

Open ggrothendieck opened 1 year ago

ggrothendieck commented 1 year ago

Not sure if this is within the scope of box but if box is regarded as a better way to use scripts then perhaps it is.

The feature would be to allow reading just part of a script. There would be some syntax that the script could use to define chunks and then box could source just specified chunks.

Some examples of use would be:

Presumably there would be some syntax like this that the script could use.

#!! chunk_name
lines of code

#!! another_chunk_name
lines of code

The box command or some other command would have an argument that specifies the chunk(s) to run.