This micro tutorial will illustrate how you can run a shell inside of a singularity container, run R from the shell, and install a package in a personal library. The package will be installed in a directory in your home folder. Each time you use the container you will be able to use the package you installed even though it is not installed in the container itself!
Open a shell in the singularity container r.sif
cd
singularity shell ${SIF_FILES}/r.sif
R
Test it.
2+2
Did it work? If so, install the package. Tell R it can install the package into a personal library when prompted to do so.
install.packages("vroom")
Quit R and exit the shell.
q()
exit