I'm trying to install gifski which is a dependency for gganimate.
I get this error.
------------------ RUST COMPILER NOT FOUND --------------------
Cargo was not found on the PATH. Please install cargo / rustc:
- yum install cargo (Fedora/CentOS)
- apt-get install cargo (Debian/Ubuntu)
- brew install rustc (MacOS)
Alternatively install Rust from: <https://www.rust-lang.org>
---------------------------------------------------------------
The yum install cargo command didn't work, so I installed Rust with
curl https://sh.rustup.rs -sSf | sh
The installation prompt said I needed to add $HOME/.cargo/bin to my path environment variable, so I tried this.
$ source $HOME/.cargo/env
$ export PATH=$PATH:$HOME/.cargo/bin
$ export PATH=$PATH:/.cargo/bin
$ export PATH=$HOME/.cargo/bin
I reset my machine and I continue to receive the same error.
> sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Amazon Linux AMI 2018.03
Related
I have installed r-integration via npm. I have placed my R script inside the node-server directory which is located at srv/nodeserver/. I have R installed in my machine.
> whereis R
R: /usr/bin/R /usr/lib/R /etc/R /usr/local/lib/R /usr/share/R /usr/share/man/man1/R.1.gz
The nodejs REST API code looks like below:
app.get('/getRresult',(req,res)=>{
let result = R.executeRScript(
'server.R',"circumference",{r:2});
console.log(result)
});
When I hit the RESTAPI url I get the following error:
Error: R not found, maybe not installed.
However R is installed because if I type R in the terminal R shell opens up. I tried exporting the path of usr/bin/R in ~/.bashrc. It still does not seem to work. I am confused which path will actually work or how to set the path for ubuntu PATH variable.
You needs to install R on your ubuntu.
Here are steps
#1 Install the dependencies necessary
to add a new repository over HTTPS:
$ sudo apt install dirmngr gnupg apt-transport-https ca-certificates software-properties-common
#2 Add the CRAN repository to your system sources’ list
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
$ sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'
#3 Install R
$ sudo apt install r-base
#4 Verify R version
R --version
Terminal Output
$ R --version
R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
https://www.gnu.org/licenses/.
#5 Finally run simple example
test.js will call test.R by R.executeRScript()
It will return value into test.js then it will console.log()
file name save as test.js
const R = require('r-integration');
let result = R.executeRScript("./test.R");
console.log(result);
file name save as test.R
x <- 5
y <- 6
z <- 3
result <- max(x, y, z)
print(result)
Install r-integration library
npm install r-integration
Run it and see the Result
$ node test.js
[ 6 ]
References
R-integration - Node JS API
How to Install R on Ubuntu 20.04
I am sure this is a trivial question, but I am trying to install multiple R versions in Linux. I am not using R studio server pro and am instead using the free R studio server. I followed this documentation to install R but got errors when I attempted to locate it. However, when I run a command to see what version of R is installed, there is no error.
R is installed!
(base) noah#noah-VirtualBox:/opt/R/4.1.3$ /opt/R/4.1.3/bin/R --version
R version 4.1.3 (2022-03-10) -- "One Push-Up"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
https://www.gnu.org/licenses/.
Attempts
(base) noah#noah-VirtualBox:/opt/R/4.1.3$ R
Command 'R' not found, but can be installed with:
sudo apt install r-base-core
(base) noah#noah-VirtualBox:/opt/R/4.1.3$ which R
(base) noah#noah-VirtualBox:/opt/R/4.1.3$
Steps to reproduce
export R_VERSION=4.1.3
curl -O https://cran.rstudio.com/src/base/R-4/R-${R_VERSION}.tar.gz
tar -xzvf R-${R_VERSION}.tar.gz
cd R-${R_VERSION}
# Build and install R
./configure \
--prefix=/opt/R/${R_VERSION} \
--enable-memory-profiling \
--enable-R-shlib \
--with-blas \
--with-lapack
make
sudo make install
# Verify R installation
/opt/R/${R_VERSION}/bin/R --version
# Create a symlink to R
sudo ln -s /opt/R/${R_VERSION}/bin/R /usr/local/bin/R
sudo ln -s /opt/R/${R_VERSION}/bin/Rscript /usr/local/bin/Rscript
# Export path so Rstudio can find it
export RSTUDIO_WHICH_R='/opt/R/4.1.3/bin'
You are overcomplicating it. Just install in, say,
/opt/R/4.2.0/
/opt/R/4.1.2/
/opt/R/4.0.5/
and then either set the $PATH to the bin/ directory in the version you want, or call R directly. It is what pretty much exactly what many of us have done with two versions of R (i.e. R-release and R-devel):
$ R --version | head -1
R version 4.2.0 (2022-04-22) -- "Vigorous Calisthenics"
$
$ /usr/lib/R/bin/R --version | head -1
R version 4.2.0 (2022-04-22) -- "Vigorous Calisthenics"
$
$ /usr/local/lib/R-devel/bin/R --version | head -1
R Under development (unstable) (2022-05-24 r82398) -- "Unsuffered Consequences"
$
The first two are the same as that is my 'default' version. The third is my one alternate. And that is all there is to it.
If you add /usr/local/bin to your $PATH variable you would have been able to launch R, if it was not already present.
You could add it to .bashrc in your home directory
echo "export path=\"${PATH}:/usr/local/bin\"" |tee -a ~/.bashrc
Links for installing R from package, Ubuntu / Debian, RHEL 9, RHEL 8, RHEL/CentOS7
https://docs.posit.co/resources/install-r/
Also see
(Optional) Install multiple versions of R, on the same page.
I am trying to set up Rstudio on an Ubuntu cloud server (gcloud). I currently have version R-3.4.4 on RStudio, but would like to upgrade. The issue is, I am unable to.
I am running the following version of Ubuntu.
name#sc1:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic
I installed the RStudio server for Ubuntu 18 as suggested here: https://www.rstudio.com/products/rstudio/download-server/debian-ubuntu/
So essentially running to install the server:
sudo apt-get install gdebi-core
wget https://download2.rstudio.org/server/bionic/amd64/rstudio-server-1.4.1717-amd64.deb
sudo gdebi rstudio-server-1.4.1717-amd64.deb
Checking the version of R Studio I have:
sudo -i R
Output:
name#sc1:~$ sudo -i R
R version 4.1.0 (2021-05-18) -- "Camp Pontanezen"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
However, this is what pops up in my RStudio.
Anyone have ideas for what I'm doing wrong? How can I upgrade my package?
Furthermore, in my /home/user/R/x86_64-pc-linux-gnu-library directory, I have an R-3.4 folder, which is confusing…
Turns out that after I installed R 4.0, I had to restarted the VM and that seemed to work. Unclear why this is, but at least it worked!
I'm using Ubuntu 16.04 on Azure Linux Virtual Machine
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.5 LTS
Release: 16.04
Codename: xenial
The current R version for Rstudio/Rserver is 3.4.4 and I would like to update it to the latest version (i.e. version 3.5.2)
R --version
R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
From some reasons, the most common method doesn't work:
apt-get update
apt-get upgrade
So I did some research and find this post on biostars.org
One of the posts says the following codes might work
sudo su
echo "deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/" >> /etc/apt/sources.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
apt-get update
apt-get install r-base
apt-get install r-base-dev
However, after apt-get install r-base I'm getting the following error message:
root#VMforR:/usr/local/bin# apt-get install r-base
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
r-base : Depends: r-recommended (= 3.5.2-1xenial) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I don't understand what "held broken packages" means, and more importantly, how to update the R base?
What worked for me was to add the PPA of Michael Rutter:
sudo add-apt-repository ppa:marutter/rrutter3.5
sudo apt-get update
Update R:
sudo apt install r-api-3.5
I'm with the 16.04 LTS ubuntu.
Have tried some other methods, the following seems to work:
sudo apt-get install r-base-core=3.5.2-1xenial
Ref:
1. Install particular version(2.15.2) of r-base on ubuntu
2. https://cran.rstudio.com/bin/linux/ubuntu/xenial-cran35/
But I'm not sure if this also work for others or not, as I can't reproduce it.
After
apt-get update
do
apt-get dist-upgrade
first to "move your installation forward". That includes upgrading already installed packages. It should just upgrade your R installation (unless you also switch / need to switch repositories).
The r-sig-debian list is good and patient with basic 'how do it od X for R on Debian/Ubuntu'. Consider subscribing to lurk and/or ask questions.
Mine said some of my packages were missing. So, I ran sudo dpkg --configure -a and then re-run the R --update and it worked to correct the missing package error.
I am using RStudio and Redhat:
R version 3.3.1 (2016-06-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux Server release 6.10 (Santiago).
When trying to use the install rgeos in R, I got the following error message:
Warning in install.packages :
installation of package rgeos had non-zero exit status
After some Googling, I found the following code to install geos:
cd /path/to/src/geos/
wget http://download.osgeo.org/geos/geos-3.6.1.tar.bz2
tar -vxjf geos-3.6.1.tar.bz2
cd geos-3.6.1
./configure --prefix=/path/to/install/geos
make
make check
make install
However, I am on a shared university system and so get the following error:
/bin/mkdir -p '/path/to/install/geos/include/geos/algorithm/locate'
/bin/mkdir: cannot create directory `/path': Permission denied
I am new to Linux, so I am not sure if there is an easy fix to this problem. Thanks!