def METHOD_NAME(self, store_dir):
    if not _host_os_eq(self.target_os):
        raise ValueError('Cannot run R: host {}, target_os {}'.format(os.uname()[0], self.target_os))
    cmd = ['R', 'CMD', 'INSTALL', self.r_dir, '--build', '--install-tests', '--no-multiarch', '--with-keep.source']
    print('EXECUTING {}'.format(' '.join(cmd)))
    r = sp.Popen(cmd, stderr=sp.PIPE, universal_newlines=True)
    for line in r.stderr.readlines():
        sys.stdout.write(line)
        m = re.match(r"packaged installation of .* as .*(cat.*[z]).*", line)
        if m:
            installation = m.group(1)
    status = r.wait()
    assert status == 0, "Command failed with exit status " + str(status)
    src = os.path.join(os.getcwd(), installation)
    dst = os.path.join(store_dir, installation)
    if not os.path.samefile(src, dst):
        shutil.move(src, dst)
    return dst