The R Readme has a write-up on installing R from Source for MacOS and an existing open-source implementation in bash.
However, there's a few problems:
- This requires XCode Command Line Tools and several compilers. Installation of these dependencies requires sudo access.
- This problem could be bypassed by assuming the user has these libraries installed.
- Another solution could be to host a server with several docker images, build the pkg using a cookiecutter image to ensure consistent folder/file paths and download it on the user's laptop for installation.