Skip to content

Instantly share code, notes, and snippets.

@yht
Created June 15, 2020 04:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yht/4f0c7b04c57638e8ac548c1e6dcefb51 to your computer and use it in GitHub Desktop.
Save yht/4f0c7b04c57638e8ac548c1e6dcefb51 to your computer and use it in GitHub Desktop.
Compile R and Build Desktop RStudio Env based on compiled R
#!/bin/bash
cd ~/R/C
wget -c https://cran.r-project.org/src/base/R-4/R-$1.tar.gz
tar xf R-$1.tar.gz
cd R-$1
./configure --prefix=$HOME/Aplikasi/R-$1 \
--enable-R-shlib=yes --with-blas=yes --with-lapack=yes \
--with-x=no --with-readline=no
make
make check
make install
cd
deploy-r.sh $1
#!/bin/bash
cat > $HOME/Desktop/rstudio-$1.desktop << EOT
[Desktop Entry]
Exec=/home/yht/bin/rstudio-$1.sh
Icon=rstudio
Type=Application
Terminal=false
Name=R-$1
Categories=Development;
MimeType=text/x-r-source;text/x-r;text/x-R;text/x-r-doc;text/x-r-sweave;text/x-r-markdown;text/x-r-html;text/x-r-presentation;application/x-r-data;
EOT
cat > $HOME/bin/rstudio-$1.sh << EOT
#!/bin/bash
export RSTUDIO_WHICH_R=$HOME/Aplikasi/R-$1/bin/R
/usr/lib/rstudio/bin/rstudio %F
EOT
chmod +x $HOME/bin/rstudio-$1.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment