I'm not 100% following your question here. It should be possible to turn this into an RPM, I would expect, although I know little about the process. For reference, this is what a build from source looks like on my system:
$ cat /opt/R/3.6.0/bin/R | head
#!/bin/bash
# Shell wrapper for R executable.
R_HOME_DIR=/opt/R/3.6.0/lib/R
if test "${R_HOME_DIR}" = "/opt/R/3.6.0/lib/R"; then
case "linux-gnu" in
linux*)
run_arch=`uname -m`
case "$run_arch" in
x86_64|mips64|ppc64|powerpc64|sparc64|s390x)
Ideally, you would build and unpack the built version of R into the same location. The build of R will use the --prefix path to determine what R_HOME_DIR is. Your packaging / reusing process should not change that.
Is the head command you show something you executed on the built version, or the unpack? What does your build process look like? It looks like something weird happened to that first line... 