Not able to install tm package in R Studio in Fedora-25 - r

I am getting this error and i have tried every other solution related to this given on stackoverflow but still not able to install the package.Please suggest a solution.And how can i install any R package using source on linux?

You can try the following:
In shell:
sudo yum install -y epel-release
sudo yum install glibc-common
sudo yum install -y rpm-build make wget tar libxml2-devel
In R:
install.packages('xml2')
Instructions are adapted from https://github.com/opencpu/opencpu-server/tree/master/rpm#readme
Please let me know if it works.

Related

Installing R 4.1 from source on newly installed Ubuntu 20.04

I tried to install R 4.1 on a newly set-up Ubuntu 20.04. After some struggle with the repositories and keys, I chose to install from source.
Visited https://www.r-project.org/ to download latest version of R. Ran ./configure multiple times to note the requirement of various libraries which you may note as follows. I am hoping this will save significant amount of time for anyone intending to build from source. Suggestions welcome for speeding up the process or better solution. However my intention is to share entire set of libraries that I had to install on a naked installation of 20.04 on which the very first package I tried to install was R 4.1 (from source).
Directory where you downloaded the tar.gz (e.g. R-4.1.2.tar.gz in my case)
cd Downloads
Untar
tar -xvzf R-4.1.2.tar.gz
Enter directory
cd R-4.1.2
As root
sudo su
Try validating configuration (encountered many errors throughout and following libraries were installed)
./configure
Installed various libraries:
apt-get install build-essential
apt-get install gfortran
apt-get install fort77
apt-get install libreadline-dev
apt-get install xorg-dev
apt-get install liblzma-dev libblas-dev
apt-get install gcc-multilib
apt-get install libbz2-dev
apt-get install libpcre2-dev
apt-get install libcurl4-openssl-dev
apt install default-jdk
make
make install
The above set worked for me and I am hopeful it may be of help.

launching R in AWS EC2

I am trying to launch an R instance in AWS EC2. I have opted for the free tier and use the Amazon Linux AMI. In user data I have specified in the following manner to install R and Rstudio:
#!/bin/bash
# install R
yum install -y R
# install RStudio-Server
wget https://download2.rstudio.org/server/centos6/x86_64/rstudio-server-rhel-1.2.5033-
x86_64.rpm
yum install -y --nogpgcheck rstudio-server-rhel-1.2.5033-x86_64.rpm
yum install -y curl-devel
yum install -y openssl openssl-devel
# add user
useradd forecasting
echo forecasting:testing | chpasswd
However, the R version is not the latest one - how do I modify this code to download the latest version of R?
Using the instructions in this installing R for RStudio link, I think the following might work for Centos 6. Unfortunately I can't check it, but it might give you something to work from.
#!/bin/bash
# install R runtime dependencies
yum install epel-release
# set R version
R_VERSION=3.6.2
# download and install R
wget https://cdn.rstudio.com/r/centos-6/pkgs/R-${R_VERSION}-1-1.x86_64.rpm
yum install -y R-${R_VERSION}-1-1.x86_64.rpm
# install RStudio-Server
wget https://download2.rstudio.org/server/centos6/x86_64/rstudio-server-rhel-1.2.5033-
x86_64.rpm
yum install -y --nogpgcheck rstudio-server-rhel-1.2.5033-x86_64.rpm
yum install -y curl-devel
yum install -y openssl openssl-devel
# add user
useradd forecasting
echo forecasting:testing | chpasswd

Installing R devtools package on WSL

The problem:
I'm trying to install the devtools package for R. I'm using Ubuntu 18.04 LTS on WSL, the Windows Subsystem for Linux.
I'm able to install some packages just fine with a simple call to install.packages() from within R on WSL. However, other packages seem to give me trouble.
None of the following methods I've tried seem to work:
* I've tried installing the package with install.packages().
* I've tried installing from source into /usr/local/lib/R/site-library.
* I've tried installing from source into a personal library.
Error message:
I was recieving an error message like that discussed here, but I was unable to fix the problem by editing unpackPkgZip because it didn't exist.
The Question:
How can I install devtools on WSL?
Solution:
I was able to fix the problem by starting over. I uninstalled Ubuntu and then reinstalled it. With a fresh install of Ubuntu 18.04 I followed these instructions. There are other online tutorials which probably work just fine, but I followed this one. You can ignore the bit about installing an rstudio server and the fsl package if you wish.
# Install R on WSL
sudo apt-get update -qq -y
sudo apt-get install -y wget git
OS_DISTRIBUTION=$(lsb_release -cs)
wget -O- http://neuro.debian.net/lists/${OS_DISTRIBUTION}.us-nh.full | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
sudo apt-key adv --recv-keys --keyserver hkp://pool.sks-keyservers.net:80 0xA5D32F012649A5A9
sudo apt-get update
sudo apt-get install libopenblas-base r-base
sudo apt-get update -qq -y
sudo apt-get install -y libgit2-dev
sudo apt-get install -y libcurl4-openssl-dev libssl-dev
sudo apt-get install -y zlib1g-dev libssh2-1-dev libpq-dev libxml2-dev
#sudo apt-get install -y libhdf5 # This didn't work.
Now try installing devtools in R.
# Install devtools
install.packages("devtools", repos = "https://cran.rstudio.com/")
Permission error:
If you encounter a permission error like the following...
Warning in install.packages("edgeR") :'lib = "/usr/local/lib/R/site-library"' is not writable Would you like to use a personal library instead? (y/n)
...you need to provide the user with write access to the directory where R packages are installed (see here). Try changing the group ownership of this directory:
# Who has ownership of /usr/local/lib/R/site-library/?
ls -l /usr/local/lib/R/
# drwxrwsr-x 1 root staff 512 Jul 18 21:38 site-library
# Change ownership.
sudo chgrp twesleyb /usr/local/lib/R/site-library/
ls -l /usr/local/lib/R/
#drwxrwxr-x 1 root twesleyb 512 Jul 18 21:38 site-library
# In this case I have write access, but in case you need to add it, try:
# $ sudo chmod g+w /usr/local/lib/R/site-library
You should now be able to install.packages("package").
I'm a linux novice, but I think this is an okay thing to do.
Update:
You can also try following duckmayr's instructions.

how can i install the packages in r properly and correctly using Rstudio app?

I tried to install "xlsx" package using Rstudio, and i couldn't install it.
I am trying to install my packages using install.packages("xlsxjars"). I already tried doing that from Tools window in Rstudio app, and I tried using the console.
I am using Linux (Gnome 17.04). I get this error:
input
install.packages("xlsxjars")
output
Installing package into ‘/home/aim/R/x86_64-pc-linux-gnu-library/3.3’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/xlsxjars_0.6.1.tar.gz'
Error in install.packages : error reading from connection
if you get some Errors while installing r packages kind of somthing.so is miising or some packages are missing depending on the version of R, you should try this commands because, i had this kind of errors with R 3.0.x in Ubuntu 14.04
so i upgrade my R version to fix it with the following commands :
sudo sh -c 'echo "deb http://cran.rstudio.com/bin/linux/ubuntu trusty/" »
gpg —keyserver keyserver.ubuntu.com —recv-key E084DAB9
gpg -a —export E084DAB9 | sudo apt-key add -
sudo apt-get —purge remove r-base-core
sudo apt-get update
sudo apt-get -y install r-base
sudo apt-get update
now i can install all packages without errors
I totally agree with the answer of #kissi salim yahia
Just want to add . When you tape in R
install.packages("your_package")
you got some dependencies below.
these one may have troubles sometimes. So just need to install them manually from the SHELL like:
sudo apt-get install r-cran-your_dependencie
I spent a while struggling with that too. Eventually I just gave up as the java in that package was out of date and I would have needed to load older Java up to get it to run. I would suggest readxl instead.
A simple intro to the package can be found here: https://www.datacamp.com/community/tutorials/r-tutorial-read-excel-into-r#readxl

Errors while installing Rstudio

I am trying to install Rstudio. I have downloaded the rstudio-0.98.1103-deb package.
This is the error I am getting when I do:
sudo dpkg -i rstudio-0.98.1103-amd64.deb
How do I go about the installation? Any suggestions would be great. I am on Ubuntu 14.04.
Package libjpeg62 is not installed.
You can get it by typing this in Terminal:
sudo apt-get install libjpeg62
It tells you pretty clearly that you libjpeg62.
So do sudo apt-get install libjpeg62 and then reinstall RStudio.

Resources