I am using Ubuntu 18.04 with R (3.4.4)/RStudio (1.2.1335) and am having great difficulty in installing some packages. For the purpose of this question, I will use the Tidyverse as an example.
Using RStudio, I run:
install.packages("tidyverse", dependencies = TRUE)
And after what looks like a good start ("trying X-package, downloading X-package..."), the installation then becomes plagued with error messages galore. (Note this happens regardless of whether I set dependencies
to TRUE
or FALSE
.)
I have read the error messages' advice and followed the instructions and nothing changes. I have spent literally hours researching ways online to figure this out and trying different methods (such as specifying folders/directories to store the packages to, reinstalling some software, removing other software, and several other things) and still nothing changes.
I have fully uninstalled and reinstalled R/RStudio and still the same thing occurs.
For example, when I run the above code, this is where things start to go wrong:
* installing *source* package ‘curl’ ...
** package ‘curl’ successfully unpacked and MD5 sums checked
Found pkg-config cflags and libs!
/home/mus/.R/Makevars:1: *** missing separator. Stop.
/home/mus/.R/Makevars:1: *** missing separator. Stop.
/home/mus/.R/Makevars:1: *** missing separator. Stop.
Using PKG_CFLAGS=-I/usr/include/x86_64-linux-gnu
Using PKG_LIBS=-lcurl
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libcurl was not found. Try installing:
* deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
* rpm: libcurl-devel (Fedora, CentOS, RHEL)
* csw: libcurl_dev (Solaris)
If libcurl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libcurl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘curl’
* removing ‘/home/mus/R/x86_64-pc-linux-gnu-library/3.4/curl’
Warning in install.packages :
installation of package ‘curl’ had non-zero exit status
* installing *source* package ‘haven’ ...
** package ‘haven’ successfully unpacked and MD5 sums checked
** libs
/home/mus/.R/Makevars:1: *** missing separator. Stop.
ERROR: compilation failed for package ‘haven’
* removing ‘/home/mus/R/x86_64-pc-linux-gnu-library/3.4/haven’
The length of this message is significantly larger - I have merely truncated it for the purpose of this question.
My question is this: what could I be missing here? I don't think it should be so difficult to resolve, yet it is proving to be one of the single most complicated problems I have ever come up against and I cannot think of what it could possibly be.
Are there any tips and tricks that those of you who have had similar experiences can share?
How can I avoid these error messages? (Note that this also happens when I try running the same command from the Terminal.)
Also, if it helps:
> .libPaths()
[1] "/home/mus/R/x86_64-pc-linux-gnu-library/3.4" "/usr/local/lib/R/site-library"
[3] "/usr/lib/R/site-library" "/usr/lib/R/library"
apt-cache search tidyverse
results inr-cran-rlang - Functions for Base Types and Core R and 'Tidyverse' Features r-cran-tidyselect - GNU R select from a set of strings
. – MusTheDataGuy Apr 26 '19 at 17:36curl
is already fully up-to-date / the newest version(7.58.0-2ubuntu3.6)
. – MusTheDataGuy Apr 26 '19 at 17:44deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/
andppa:marutter/c2d4u3.5
as PPA repositories. – user68186 Apr 26 '19 at 21:20r-cran-tidyverse
to the list of packages to install via the CLI. I then added the other packages via this method and all is working correctly. I'm not entirely sure why this is but nevertheless, it works. Thank you. – MusTheDataGuy Apr 27 '19 at 10:09sudo apt install r-cran-anytime
); how can I now load it in RStudio? I triedlibrary(tidyverse)
but it didn't work as I am told that the library doesn't exist. – MusTheDataGuy May 06 '19 at 21:07library(packagename)
should work. I am not familiar withanytime
ortidyverse
. – user68186 May 06 '19 at 21:31Tidyverse
andanytime
and then went through RStudio tryinglibrary(tidyverse)
and receivedError: package or namespace load failed for ‘tidyverse’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/home/mus/R/x86_64-pc-linux-gnu-library/3.5/stringi/libs/stringi.so': libicui18n.so.60: cannot open shared object file: No such file or directory
. I tried restarting the machine and still got the same error message. Am I missing something here? – MusTheDataGuy May 06 '19 at 21:37