installation package "tm" fails - r

I am trying to install package "tm" and get an error (see below). From this error I can't see what is going wrong. Package Rcpp is installed. Working on R 3.4.0, Xubuntu 64.
How can I install package tm?
* installing *source* package ‘tm’ ...
** package ‘tm’ successfully unpacked and MD5 sums checked
** libs
g++ -I/usr/share/R/include -DNDEBUG -I"/home/henk/R/x86_64-pc-linux-gnu-library/3.4/BH/include" -I"/home/henk/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o
In file included from /home/henk/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp.h:34:0,
from RcppExports.cpp:4:
/home/henk/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/grow.h:73:47: fatal error: Rcpp/generated/grow__pairlist.h: No such file or directory
compilation terminated.
/usr/lib/R/etc/Makeconf:168: recipe for target 'RcppExports.o' failed
make: *** [RcppExports.o] Error 1
ERROR: compilation failed for package ‘tm’
* removing ‘/home/henk/R/x86_64-pc-linux-gnu-library/3.4/tm’
Warning in install.packages :
installation of package 'tm' had non-zero exit status
The downloaded source packages are in
'/tmp/Rtmp3tKSat/downloaded_packages'

At first we can install "devtools" packages and than install "tm"
by using devtools::install_cran("tm")

try
sudo apt-get install r-cran-rcpp

Related

fatal error installing systemfonts in jupyter R docker

I am running jupyterlabs on docker and wanted to install the rvg package. One of the dependencies are systemfonts, and when I tried to install this using install.packages("systemfonts") I get:
Warning: unable to access index for repository https://cran.yu.ac.kr/src/contrib:
cannot open URL 'https://cran.yu.ac.kr/src/contrib/PACKAGES'
Warning message:
package ‘systemfonts’ is not available for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
So I downloaded the tar.gz file from CRAN and installed from file, but I get a fatal error:
> install.packages("systemfonts_1.0.2.tar.gz", repo = NULL, type = "source")
* installing *source* package ‘systemfonts’ ...
** package ‘systemfonts’ successfully unpacked and MD5 sums checked
** using staged installation
Using PKG_CFLAGS=
Using PKG_LIBS=-lfontconfig -lfreetype
** libs
rm -f systemfonts.so caches.o cpp11.o dev_metrics.o font_matching.o font_registry.o ft_cache.o string_shape.o font_metrics.o font_fallback.o string_metrics.o emoji.o cache_store.o init.o unix/FontManagerLinux.o
x86_64-conda-linux-gnu-c++ -std=gnu++11 -I"/opt/conda/lib/R/include" -DNDEBUG -I'/opt/conda/lib/R/library/cpp11/include' -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /opt/conda/include -I/opt/conda/include -Wl,-rpath-link,/opt/conda/lib -fpic -fvisibility-inlines-hidden -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /opt/conda/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/r-base-split_1607284869564/work=/usr/local/src/conda/r-base-4.0.3 -fdebug-prefix-map=/opt/conda=/usr/local/src/conda-prefix -c caches.cpp -o caches.o
In file included from caches.h:7,
from caches.cpp:1:
ft_cache.h:9:10: fatal error: ft2build.h: No such file or directory
9 | #include <ft2build.h>
| ^~~~~~~~~~~~
compilation terminated.
make: *** [/opt/conda/lib/R/etc/Makeconf:181: caches.o] Error 1
ERROR: compilation failed for package ‘systemfonts’
* removing ‘/opt/conda/lib/R/library/systemfonts’
Warning message:
In install.packages("work/corehead_data/systemfonts_1.0.2.tar.gz", :
installation of package ‘work/corehead_data/systemfonts_1.0.2.tar.gz’ had non-zero exit status
I tried to follow this SO Post, by typing in sudo apt-get install -y libfreetype6 to get freetype, but it is already the newest version. I'm not sure what else to try, hopefully someone can provide some expertise. Thanks.
Searching for "ft2build.h: No such file or directory Ubuntu" leads to this issue on systemfonts library GitHub where a workaround for the compilation error for Ubuntu 20.04 is shown:
sudo apt-get update
sudo apt-get install libfontconfig1-dev
This should help you to compile library from the tar.gz source.

gcc can't compile R packages under Linux Mint: can't find stdlib.h

I'm trying to install the R package gtools from the Linux Mint command line. After choosing the closest CRAN mirror, I'm getting the error message that no such file or directory was found and that installation of the package had a non-zero exit status. More specifically:
> install.packages('gtools')
Installing package into ‘/home/lizi/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
trying URL 'https://cloud.r-
project.org/src/contrib/gtools_3.5.0.tar.gz'
Content type 'application/x-gzip' length 64855 bytes (63 KB)
==================================================
downloaded 63 KB
* installing *source* package ‘gtools’ ...
** package ‘gtools’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c roman2int.c -o roman2int.o
In file included from roman2int.c:1:0:
/usr/share/R/include/R.h:55:80: fatal error: stdlib.h: No such file or
directory
compilation terminated.
/usr/lib/R/etc/Makeconf:159: recipe for target 'roman2int.o' failed
make: *** [roman2int.o] Error 1
ERROR: compilation failed for package ‘gtools’
* removing ‘/home/lizi/R/x86_64-pc-linux-gnu-library/3.4/gtools’
The downloaded source packages are in
‘/tmp/Rtmp0z5PS6/downloaded_packages’
Warning message:
In install.packages("gtools") :
installation of package ‘gtools’ had non-zero exit status
The package has no dependencies, and I was under the impression that install.packages was straightforward. What am I doing wrong?

ERROR: compilation failed for package ‘rlang’ in rstudio - Debian jessie 8.0

I am trying to install 'forecast' package in R (version 3.1.1 64bit) on my Debian jessie machine.
I have installed other R packages required for my analyses. However, when I try to install 'forecast' package it require dependencies, namely, rlang, tipple and ggplot2. It looks from the error log (shown below) tipple and ggplot2 requires rlang to be installed for them to be installed.
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c sexp.c -o sexp.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c splice.c -o splice.o
In file included from splice.c:2:0:
vector.h: In function ‘namespace_rlang_sym’:
vector.h:94:19: error: ‘R_DoubleColonSymbol’ undeclared (first use in this function)
return(Rf_lang3(R_DoubleColonSymbol, rlang_sym, sym));
^
vector.h:94:19: note: each undeclared identifier is reported only once for each function it appears in
/usr/lib/R/etc/Makeconf:128: recipe for target 'splice.o' failed
make: *** [splice.o] Error 1
ERROR: compilation failed for package ‘rlang’
removing ‘/usr/local/lib/R/site-library/rlang’
Warning in install.packages :
installation of package ‘rlang’ had non-zero exit status
ERROR: dependency ‘rlang’ is not available for package ‘tibble’
* removing ‘/usr/local/lib/R/site-library/tibble’
Warning in install.packages :
installation of package ‘tibble’ had non-zero exit status
ERROR: dependency ‘tibble’ is not available for package ‘ggplot2’
* removing ‘/usr/local/lib/R/site-library/ggplot2’
Warning in install.packages :
installation of package ‘ggplot2’ had non-zero exit status
ERROR: dependency ‘ggplot2’ is not available for package ‘forecast’
* removing ‘/usr/local/lib/R/site-library/forecast’
Warning in install.packages :
installation of package ‘forecast’ had non-zero exit status
rlang installation fails with the above error message. Any expert help would be much appreciated.
I think the issue is your R version, based on this issue which generates the same error. Some of the "tidyverse" packages such as tibble and rlang are quite recent and require newer R versions.
So: try updating your R version. The latest is 3.4.0.

Installing package "chron" in R

Running Ubuntu 14.04 and while installing the package chron on R, I get the following message:
* installing *source* package ‘chron’ ...
** package ‘chron’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c chron_strs.c -o chron_strs.o
gcc: error trying to exec 'cc1': execvp: No such file or directory
make: *** [chron_strs.o] Error 1
ERROR: compilation failed for package ‘chron’
* removing ‘/home/ncoupe/R/x86_64-pc-linux-gnu-library/3.2/chron’
The downloaded source packages are in
‘/tmp/Rtmp1v7Xja/downloaded_packages’
Warning message:
In install.packages("chron") :
installation of package ‘chron’ had non-zero exit status
Any suggestions
Thanks
Natalia
chron has several non R dependencies. The easiest way to install it is
sudo apt-get update
sudo apt-get install r-cran-chron

Installing a cassandra package

I'm new to R and cassandra, I'm trying to install the rcassandra package. On the rforge.net site, it says to do:
> install.packages('RCassandra',,'http://www.rforge.net/')
Warning: unable to access index for repository http://www.rforge.net/src/contrib
Warning message:
package ‘RCassandra’ is not available (for R version 3.1.0)
Trying a different repository
> install.packages('RCassandra',repo='http://cran.cnr.Berkeley.edu/')
Installing package into ‘/home/as/R/x86_64-redhat-linux-gnu-library/3.1’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository http://cran.cnr.Berkeley.edu/src/contrib/
Warning message:
package ‘RCassandra’ is not available (for R version 3.1.0)
I tried installing from command line, but that does'nt seem to work either:
> sudo R CMD INSTALL RCassandra_0.1\-3.tar.gz
* installing to library ‘/home/as/R/x86_64-redhat-linux-gnu-library/3.1’
* installing *source* package ‘RCassandra’ ...
** package ‘RCassandra’ successfully unpacked and MD5 sums checked
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c cass.c -o cass.o
cass.c:1: sorry, unimplemented: 64-bit mode not compiled in
make: *** [cass.o] Error 1
ERROR: compilation failed for package ‘RCassandra’
* removing ‘/home/as/R/x86_64-redhat-linux-gnu-library/3.1/RCassandra
So how do I install the package? I can see the package on the web sites

Resources