It is possible. However, " Calling system("module load my_module") from inside a R process" as you do simply sets the variables in the subprocess spawned by the system call, which goes away when that subprocess ends and returns to R.
You want to change the environment of the process R is running in.
Sys.setenv(myvar="myval") can be used to set a single environment variable. A step in the direction, but not enough.
readRenviron lets you "Set Environment Variables from a File"
So, If you had an process to build such a file "on the fly" from your module, you could save its output as a temp file, load the temp file, and delete it.
Here is a process that works from the command-line for the module named "cuda"
mymod=cuda sh -c 'eval modulecmd bash load ${mymod} ; env'
So, build strings like that in R, and pass them to system (piping their output to a temp file).
Or, probably better, use Rs system2 command to pass the value of mymod in the environment and specify where stdout should go. And tempfile to get a safe place to put that stdout.
Then load that temp file with readRenviron ... and don't forget to delete it.
But, why do you really want to do this? And do you really want to do it in the middle of an ongoing R session? I suppose if you were in the middle of a long running R session with lots of state and you want to use one of your environment module programs and not lose the state of your session would be a good idea.
And, if you're wanting to do all this under RStudio Server and are not the admin of the server, then you need to get some cookies for the admin to contrive for environment modules to even be available. The cookies might have to be special if you're using the open source or "Prof" version of RStudio Server.
Might this work on Windows? No idea.
Let us know if you put the pieces together.
I don't see any other way of doing it.