RMongo installation fails with Segmentation Fault in Ubuntu - r

I've been for last couple of hours trying to install the RMongo package with the following output:
> install.packages("RMongo")
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
trying URL 'https://repo.bppt.go.id/cran/src/contrib/RMongo_0.0.25.tar.gz'
Content type 'application/x-gzip' length 4169519 bytes (4.0 MB)
==================================================
downloaded 4.0 MB
* installing *source* package ‘RMongo’ ...
** package ‘RMongo’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Segmentation fault (core dumped)
ERROR: loading failed
* removing ‘/usr/local/lib/R/site-library/RMongo’
The downloaded source packages are in
‘/tmp/RtmpHZoomn/downloaded_packages’
Warning message:
In install.packages("RMongo") :
installation of package ‘RMongo’ had non-zero exit status
I've also identified the same error trying to install xlsx.
I don't know what has changed in the past distros, since I've tried this with Ubuntu 16.04.2 and Ubuntu 17.04, with the same result.
This is a description of the R environment in the Ubuntu 16.04.2 distro:
> sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.2 LTS
Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.6.0
LAPACK: /usr/lib/lapack/liblapack.so.3.6.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=es_ES.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=es_ES.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=es_ES.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=es_ES.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.4.0 tools_3.4.0 tcltk_3.4.0
Any idea about what can be happening?

linux-image-3.13.0-121-generic and linux-image-4.4.0-81-generic contain a fix for the Stack Clash vulnerability.
Be careful with kernel updates, which fix this vulnerability. Current patch breaks many java (sun/oracle and openjdk) applications. See Bug #1699772: linux-image-4.4.0-81-generic, linux-image-3.13.0-121-generic Regression: many user-space apps crashing. The solution is to temporary reboot system with old kernel (linux-image-3.13.0-119-generic in Trusty).
Ubuntu kernel developers will prepare new patch in a few days.
UPDATE: Latest updates (at least image-4.4.0-83-generic, linux-image-4.8.0-58-generic, linux-image-4.10.0-26-generic) fix this vulnerability and problems with user-space programs.

This doesn't answer to the problems that I'm experiencing with RMongo, but solves the problem for me, so I hope it can be useful.
I've continued making some tests. Since this problem started when RMongo suddenly stopped from working, and taking into account that I had a similar installation that was working properly, I started to compare both environments.
I've checked that, in the system that is failing, some software updates were performed (you can check them below):
The following NEW packages will be installed
libmircommon7 libmircore1 linux-headers-4.4.0-81 linux-headers-4.4.0-81-generic linux-image-4.4.0-81-generic
linux-image-extra-4.4.0-81-generic
The following packages will be upgraded:
click firefox firefox-locale-en flashplugin-installer gir1.2-click-0.4 google-chrome-stable grub-common grub-pc
grub-pc-bin grub2-common libc-bin libc-dev-bin libc6 libc6:i386 libc6-dbg libc6-dev libclick-0.4-0 libepoxy0
libgnutls-openssl27 libgnutls30 libmirclient9 libmircookie2 libmirprotobuf3 libmwaw-0.3-3 libnss3 libnss3-nssdb
libqt5concurrent5 libqt5core5a libqt5dbus5 libqt5gui5 libqt5network5 libqt5opengl5 libqt5printsupport5 libqt5sql5
libqt5sql5-sqlite libqt5test5 libqt5widgets5 libqt5xml5 libssl-dev libssl-doc libssl1.0.0 libvlc5 libvlccore8
libzzip-0-13 linux-firmware linux-headers-generic linux-image-generic linux-libc-dev locales multiarch-support
openssl python3-click-package vlc vlc-data vlc-nox vlc-plugin-notify vlc-plugin-samba
So, I've checked one by one this packages, and it turns out that the root of the problem is the new kernel 4.4.0-81.
In order to be sure that this is the root of the problem, I've launched by Ubuntu distro with the previous version of the kernel that I had in my laptop: 4.4.0-79
And this is the result of the installation:
> install.packages("RMongo")
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
trying URL 'https://pbil.univ-lyon1.fr/CRAN/src/contrib/RMongo_0.0.25.tar.gz'
Content type 'application/x-gzip' length 4169519 bytes (4.0 MB)
==================================================
downloaded 4.0 MB
* installing *source* package ‘RMongo’ ...
** package ‘RMongo’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (RMongo)
The downloaded source packages are in
‘/tmp/RtmpJScKfz/downloaded_packages’
> install.packages("xlsx")
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://pbil.univ-lyon1.fr/CRAN/src/contrib/xlsx_0.5.7.tar.gz'
Content type 'application/x-gzip' length 312839 bytes (305 KB)
==================================================
downloaded 305 KB
* installing *source* package ‘xlsx’ ...
** package ‘xlsx’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (xlsx)
The downloaded source packages are in
‘/tmp/RtmpJScKfz/downloaded_packages’
Both packages, xlsx and RMongo, are now successfully installed and working.
I've also checked the relationship between xlsx and RMongo, and I'm afraid that problem underneath is rJava (common dependency). As a matter of fact, in order to be sure about this, I've made tests with other packages rJava-dependant (RWeka) and I had the same problem, solved after changing the kernel version.
== UPDATE ==
After the last kernel update, from 4.4.0-81 to 4.4.0-83, the problem has been fixed.

Same problem (at least for package "xlsx") occurs in Ubuntu 14.04 LTS with kernel 3.13.0-121-generic. When booting with the previous kernel (3.13.0-119-generic) installation works and library loads.
UPDATE: problem appears to be solved in Ubuntu 14.04 LTS by new kernel 3.13.0-123-generic

Related

Cannot install R packages on new Ubuntu Device

I am a medical doctor (so no computer science background at all) starting to get involved with bioinformatic analyses of big datasets and have used R on my private Windows laptop in the past without any problems.
My department now bought a new powerful Laptop to speed up the analyses and our bioinformatics core facility recommended using a Linux system (which I have never really used before), so now I have this great Ubuntu laptop but I'm getting a little frustrated with just setting up my R environment to start working. I've heard Linux needs some time to get used to and I'm up for the challenge and want to try to understand what I'm doing.
So the problem I have is that I cannot really install certain packages in R. As I said the laptop is brand new and installing R and RStudio was one of the first things I did without changing anything in the basic settings of the laptop. So I was very surprised that I keep getting errors in something as simple as installing those packages. For some reason some packages like
install.packages("tidyverse")
work fine, while others fail. So
install.packages("devtools")
gives me the following output
Installing package into ‘/home/jasper/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
also installing the dependencies ‘systemfonts’, ‘textshaping’, ‘ragg’, ‘pkgdown’
trying URL 'https://cloud.r-project.org/src/contrib/systemfonts_1.0.4.tar.gz'
Content type 'application/x-gzip' length 81757 bytes (79 KB)
==================================================
downloaded 79 KB
trying URL 'https://cloud.r-project.org/src/contrib/textshaping_0.3.6.tar.gz'
Content type 'application/x-gzip' length 35722 bytes (34 KB)
==================================================
downloaded 34 KB
trying URL 'https://cloud.r-project.org/src/contrib/ragg_1.2.4.tar.gz'
Content type 'application/x-gzip' length 427579 bytes (417 KB)
==================================================
downloaded 417 KB
trying URL 'https://cloud.r-project.org/src/contrib/pkgdown_2.0.7.tar.gz'
Content type 'application/x-gzip' length 871465 bytes (851 KB)
==================================================
downloaded 851 KB
trying URL 'https://cloud.r-project.org/src/contrib/devtools_2.4.5.tar.gz'
Content type 'application/x-gzip' length 374718 bytes (365 KB)
==================================================
downloaded 365 KB
* installing *source* package ‘systemfonts’ ...
** package ‘systemfonts’ successfully unpacked and MD5 sums checked
** using staged installation
Package fontconfig was not found in the pkg-config search path.
Perhaps you should add the directory containing `fontconfig.pc'
to the PKG_CONFIG_PATH environment variable
No package 'fontconfig' found
Package freetype2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `freetype2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'freetype2' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lfontconfig -lfreetype
--------------------------- [ANTICONF] --------------------------------
Configuration failed to find the fontconfig freetype2 library. Try installing:
* deb: libfontconfig1-dev (Debian, Ubuntu, etc)
* rpm: fontconfig-devel (Fedora, EPEL)
* csw: fontconfig_dev (Solaris)
* brew: freetype (OSX)
If fontconfig freetype2 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a fontconfig freetype2.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 MESSAGE] ---------------------------
<stdin>:1:10: fatal error: fontconfig/fontconfig.h: No such file or directory
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘systemfonts’
* removing ‘/home/jasper/R/x86_64-pc-linux-gnu-library/4.2/systemfonts’
Warning in install.packages :
installation of package ‘systemfonts’ had non-zero exit status
ERROR: dependency ‘systemfonts’ is not available for package ‘textshaping’
* removing ‘/home/jasper/R/x86_64-pc-linux-gnu-library/4.2/textshaping’
Warning in install.packages :
installation of package ‘textshaping’ had non-zero exit status
ERROR: dependencies ‘systemfonts’, ‘textshaping’ are not available for package ‘ragg’
* removing ‘/home/jasper/R/x86_64-pc-linux-gnu-library/4.2/ragg’
Warning in install.packages :
installation of package ‘ragg’ had non-zero exit status
ERROR: dependency ‘ragg’ is not available for package ‘pkgdown’
* removing ‘/home/jasper/R/x86_64-pc-linux-gnu-library/4.2/pkgdown’
Warning in install.packages :
installation of package ‘pkgdown’ had non-zero exit status
ERROR: dependency ‘pkgdown’ is not available for package ‘devtools’
* removing ‘/home/jasper/R/x86_64-pc-linux-gnu-library/4.2/devtools’
Warning in install.packages :
installation of package ‘devtools’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpZcPwU9/downloaded_packages’
After looking online for a couple of days now, I believe that there is a problem with the directories or access to them. When I enter
.libPaths()
in R, it gives me
[1] "/home/jasper/R/x86_64-pc-linux-gnu-library/4.2" "/usr/local/lib/R/site-library"
[3] "/usr/lib/R/site-library" "/usr/lib/R/library"
So I started looking into this and tried to modify R_LIBS_USER part of the Renviron file as described here (How do I change the default library path for R packages) without any success.
When I tried installing another package, I got the message that the path is not writable and I read this might be a permission problem. So I used used chmod -R 777 on the four directories (which as far as I understood gives me all permissions to these folders) that showed up with .libPaths(), but no success either. Repeated reinstallation of R and RStudio did not help either.
Unfortunately my computer science skills quickly find their limit (even working with the terminal to be honest). Since I honestly do not really understand what I am doing and would like to do so while changing files in the root of this new laptop, I am hoping that you can help me out. Quitting and changing back to Windows is not an option for my ego :D .
Here is my sessionInfo():
R version 4.2.2 Patched (2022-11-10 r83330)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.5 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=de_DE.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=de_DE.UTF-8
[6] LC_MESSAGES=en_US.UTF-8 LC_PAPER=de_DE.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.2.2 fastmap_1.1.0 cli_3.4.1 htmltools_0.5.4 tools_4.2.2 rstudioapi_0.14 yaml_2.3.6 rmarkdown_2.19
[9] knitr_1.41 xfun_0.35 digest_0.6.31 rlang_1.0.6 evaluate_0.19
I would really appreciate your help!
Thanks a lot,
Jasper
I had this same problem recently when trying to install devtools on a kali linux virtual box.
The way I got around it was to install dev tool directly from the linux command line (terminal) using:
sudo apt-get install r-cran-devtools
This should work on Ubuntu too. Good luck.

Error: package or namespace load failed for 'treesnip'

When trying to install the treesnip package from github using remotes::install_github("curso-r/treesnip"), I get the following error:
remotes::install_github("curso-r/treesnip")
Downloading GitHub repo curso-r/treesnip#HEAD
WARNING: Rtools is required to build R packages, but is not currently installed.
Please download and install Rtools 4.0 from https://cran.r-project.org/bin/windows/Rtools/.
√ checking for file 'C:\Users\SAR.V-LOG\AppData\Local\Temp\RtmpENiM7Q\remotes38701dfb49f3\curso-r-treesnip-c70a89b/DESCRIPTION' (375ms)
- preparing 'treesnip': (736ms)
√ checking DESCRIPTION meta-information ...
- checking for LF line-endings in source and make files and shell scripts
- checking for empty or unneeded directories
Removed empty directory 'treesnip/.github/workflows'
Removed empty directory 'treesnip/.github'
NB: this package now depends on R (>= 3.5.0)
WARNING: Added dependency on R >= 3.5.0 because serialized objects in serialize/load version 3 cannot be read in older versions of R. File(s) containing such objects: 'treesnip/inst/benchmark_parallel_processing_vignette.rds'
- building 'treesnip_0.1.0.tar.gz'
* installing *source* package 'treesnip' ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
converting help for package 'treesnip'
finding HTML links ... done
add_boost_tree_catboost html
add_boost_tree_lightgbm html
add_decision_tree_tree html
multi_predict._catboost.Model html
multi_predict._lgb.Booster html
predict_lightgbm_classification_class html
predict_lightgbm_classification_prob html
predict_lightgbm_classification_raw html
predict_lightgbm_regression_numeric html
train_catboost html
train_lightgbm html
train_tree html
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
*** arch - i386
Error: package or namespace load failed for 'treesnip':
.onLoad failed in loadNamespace() for 'treesnip', details:
call: NULL
error: The values passed to `set_encoding()` are missing arguments: 'allow_sparse_x'
error: loading failed
running stopped
*** arch - x64
Error: package or namespace load failed for 'treesnip':
.onLoad failed in loadNamespace() for 'treesnip', details:
call: NULL
error: The values passed to `set_encoding()` are missing arguments: 'allow_sparse_x'
Fejl: loading failed
running stopped
ERROR: loading failed for 'i386', 'x64'
* removing 'C:/Users/SAR.V-LOG/OneDrive - VELUX/Documents 1/R/R-4.0.2/library/treesnip'
Error: Failed to install 'treesnip' from GitHub:
(converted from warning) installation of package ‘C:/Users/SAR~1.V-L/AppData/Local/Temp/RtmpENiM7Q/file38706c2c7239/treesnip_0.1.0.tar.gz’ had non-zero exit status
my sessionInfo():
sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)
Matrix products: default
locale:
[1] LC_COLLATE=Danish_Denmark.1252 LC_CTYPE=Danish_Denmark.1252 LC_MONETARY=Danish_Denmark.1252
[4] LC_NUMERIC=C LC_TIME=Danish_Denmark.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.0.2 tools_4.0.2
I works fine when running on another PC.
I also tried changing the library location to C:/Users/SAR.V-LOG/, but that didn't help either.
Further I tried to provide INSTALL_opts = "--no-test-load". When I do that the installation finished wihtout errors, but when I try to load the library using library(treesnip) I get the same error: The values passed to set_encoding() are missing arguments: 'allow_sparse_x'
Do you know what is causing this error and how I can fix it?
treesnip is fixed. It now depends on parsnip (>= 0.1.3.9000) https://github.com/curso-r/treesnip/commit/902a33d9f156c10da6dbe1bd9cccb65926077197
Try using parsnip 0.1.3 (not the development version in this case). It looks like 0.1.3.9000 has some breaking changes coming that will be handled in a new version of parsnip-adjacent packages.
The warning message indicates:
Please download and install Rtools 4.0 from https://cran.r-project.org/bin/windows/Rtools/.
You may need to upgrade your Rtools, which can be done here: https://cran.r-project.org/bin/windows/Rtools/
Let me know if this fixes your problem.
Also I have added a GitHub Issue Here: https://github.com/tidymodels/parsnip/issues/376

Error while Installing SpatialPosition Package in Azure jupyter notebook

when i am trying to install "SpatialPostion" for R in jupyter notebook with following method:
install.packages("SpatialPosition_2.0.1.tar.gz",repos=NULL,type="source")
options(unzip='internal')
library(SpatialPosition)
tried with Zip file also (Cran site i am not able to access due to some security issue), i am getting this error :
Error in library(SpatialPosition): there is no package called ‘SpatialPosition’
Traceback:
1. library(SpatialPosition)
2. stop(txt, domain = NA)**
I tried lot possible combination given here , but still getting same error all time .hope i will get appropriate solution from you guys which can run successfully .Thanks
This installation procedure (which does not attempt to get or unzip a gz) was successful. If you try this from a fresh R session and it still does not work, perhaps try an earlier version of R (this is on 3.6.3). I can confirm that the package is available from github and not corrupted:
> install.packages("remotes")
> library(remotes)
> remotes::install_github("Groupe-ElementR/SpatialPosition")
Downloading GitHub repo Groupe-ElementR/SpatialPosition#master
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?
1: All
2: CRAN packages only
3: None
4: Rcpp (1.0.3 -> 1.0.4.6) [CRAN]
5: rlang (0.4.5 -> 0.4.6 ) [CRAN]
6: withr (2.1.2 -> 2.2.0 ) [CRAN]
7: pkgbuild (1.0.6 -> 1.0.8 ) [CRAN]
8: backports (1.1.5 -> 1.1.6 ) [CRAN]
9: ps (1.3.2 -> 1.3.3 ) [CRAN]
Enter one or more numbers, or an empty line to skip updates:
Installing 4 packages: sf, rgeos, raster, units
Installing packages into ‘C:/Users/User/Documents/R/win-library/3.6’ (as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/sf_0.9-3.zip'
Content type 'application/zip' length 42626142 bytes (40.7 MB)
downloaded 40.7 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/rgeos_0.5-3.zip'
Content type 'application/zip' length 2030318 bytes (1.9 MB)
downloaded 1.9 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/raster_3.1-5.zip'
Content type 'application/zip' length 3344411 bytes (3.2 MB)
downloaded 3.2 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/units_0.6-6.zip'
Content type 'application/zip' length 1759033 bytes (1.7 MB)
downloaded 1.7 MB
package ‘sf’ successfully unpacked and MD5 sums checked
package ‘rgeos’ successfully unpacked and MD5 sums checked
package ‘raster’ successfully unpacked and MD5 sums checked
package ‘units’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\User\AppData\Local\Temp\RtmpaGI1w7\downloaded_packages
√ checking for file
'C:\Users\User\AppData\Local\Temp\RtmpaGI1w7\remotes8a0416e2c30\Groupe-ElementR-SpatialPosition-e425314/DESCRIPTION' ...
- preparing 'SpatialPosition':
√ checking DESCRIPTION meta-information ...
- checking for LF line-endings in source and make files and shell scripts
- checking for empty or unneeded directories
- looking to see if a 'data/datalist' file should be added
- building 'SpatialPosition_2.0.1.tar.gz'
Installing package into ‘C:/Users/User/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
* installing *source* package 'SpatialPosition' ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
converting help for package 'SpatialPosition'
finding HTML links ... done
CreateDistMatrix html
CreateGrid html
SpatialPosition html
hospital html
huff html
isopoly html
mcStewart html
paris html
plotHuff html
plotReilly html
plotStewart html
quickStewart html
rasterHuff html
rasterReilly html
finding level-2 HTML links ... done
rasterStewart html
rasterToContourPoly html
reilly html
smoothy html
spatMask html
spatPts html
spatUnits html
stewart html
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (SpatialPosition)
> library(SpatialPosition)
>
This was successfully installed with this sessionInfo():
> sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252

R within Rstudio cannot find rmarkdown package

I am trying to use rmarkdown, within Rstudio (0.98.953) on a PC, for the first time. I have upgraded to the latest versions of R (3.1.1) and R studio. The output from sessionInfo() is provided at the end of this question.
As I understand it rmarkdown should be included within Rstudio. However, when I select to create a markdown document in Rstudio, a dialog box pops up saying additional packages need to be installed. The installation of rmarkdown always then fails, with the following message:
Installing package into '\\cfsk18.campus.gla.ac.uk/SSD_Home_Data_X/jm383x/My Documents/R/win-library/3.1'
(as 'lib' is unspecified)
* installing *source* package 'rmarkdown' ...
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
Warning in library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE) :
there is no package called 'rmarkdown'
Error: loading failed
Execution halted
*** arch - x64
Warning in library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE) :
there is no package called 'rmarkdown'
Error: loading failed
Execution halted
ERROR: loading failed for 'i386', 'x64'
* removing '\\cfsk18.campus.gla.ac.uk/SSD_Home_Data_X/jm383x/My Documents/R/win- library/3.1/rmarkdown'
Warning messages:
1: running command '"C:/PROGRA~1/R/R-31~1.1/bin/x64/R" CMD INSTALL -l "\\cfsk18.campus.gla.ac.uk\SSD_Home_Data_X\jm383x\My Documents\R\win-library\3.1" "C:/PROGRA~1/RStudio/R/packages/rmarkdown_0.2.49_047a80058bb4ef0b142196013d1c4dd8870d4dd9.tar.gz"' had status 1
2: In utils::install.packages("C:/Program Files/RStudio/R/packages/rmarkdown_0.2.49_047a80058bb4ef0b142196013d1c4dd8870d4dd9.tar.gz", :
installation of package 'C:/PROGRA~1/RStudio/R/packages/rmarkdown_0.2.49_047a80058bb4ef0b142196013d1c4dd8870d4dd9.tar.gz' had non-zero exit status
I assume this is something to do with using a managed desktop in my place of work. However this is not usually a problem as far fewer restrictions are placed on these machines than is usually the case, and all other packages, software etc tend to work.
I have also tried installing rmarkdown directly from github. Again the installer cannot identify the package rmarkdown itself.
What is likely to be the cause of the error?
SessionInfo output:
R version 3.1.1 (2014-07-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252 LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] tools_3.1.1
Attempt to install directly from github repo:
devtools::install_github("rstudio/rmarkdown")
Installing github repo rmarkdown/master from rstudio
Downloading master.zip from https://github.com/rstudio/rmarkdown/archive/master.zip
Installing package from C:\Users\jm383x\AppData\Local\Temp\RtmpINmLRv/master.zip
Installing rmarkdown
Installing dependencies for rmarkdown:
httpuv
Installing package into ‘\\cfsk18.campus.gla.ac.uk/SSD_Home_Data_X/jm383x/My Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.1/httpuv_1.3.0.zip'
Content type 'application/zip' length 857357 bytes (837 Kb)
opened URL
downloaded 837 Kb
package ‘httpuv’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\jm383x\AppData\Local\Temp\RtmpINmLRv\downloaded_packages
"C:/PROGRA~1/R/R-31~1.1/bin/x64/R" --vanilla CMD INSTALL \
"C:\Users\jm383x\AppData\Local\Temp\RtmpINmLRv\devtoolscec10833677\rmarkdown-master" \
--library="\\cfsk18.campus.gla.ac.uk/SSD_Home_Data_X/jm383x/My Documents/R/win- library/3.1" --install-tests
* installing *source* package 'rmarkdown' ...
** R
** inst
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
Warning in library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE) :
there is no package called 'rmarkdown'
Error: loading failed
Execution halted
*** arch - x64
Warning in library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE) :
there is no package called 'rmarkdown'
Error: loading failed
Execution halted
ERROR: loading failed for 'i386', 'x64'
* removing '\\cfsk18.campus.gla.ac.uk/SSD_Home_Data_X/jm383x/My Documents/R/win- library/3.1/rmarkdown'
Try running this code to get the latest version of the rmarkdown package, which should solve the issue:
install.packages("rmarkdown", repos = "https://cran.revolutionanalytics.com")
The issue is that the RStudio IDE looks at a static CRAN snapshot that was taken before the rmarkdown package was updated. For more information, see this link: https://groups.google.com/forum/#!topic/rropen/Kgg8z6FF40I
I wonder if the problem is the space in the path shown for the --library option to your install_github command. I know you say you've installed packages OK before, but my setup sounds just slike yours and rmarkdown works for me. I have RStudio 0.98.953 on Win7, which is a very locked-down corporate machine. I've coerced it into letting me install R packages by setting the env variable R_LIBS to my network home drive. Loading packages is slow, but I have no choice because I cannot write to the C: drive. So, my install_github command has --library="H:/Rlib". Your path has "My Documents" embedded in it. I'm not positive that's the problem, but my github installation of "rstudio/rmarkdown" did succeed. When I do File -> New File -> R Markdown, followed by a press of the "Knit HTML" button, that also completes successfully.
The RStudio github page https://github.com/rstudio/rmarkdown#installation makes it sound like manual installation of rmarkdown in RStudio isn't required, but I did it anyway because I don't always use R through RStudio. Sorry, but I didn't test RStudio by making a new R Markdown file before I manually installed the package.
The RStudio blog post http://blog.rstudio.org/2014/06/18/r-markdown-v2/ says clearly that the rmarkdown package is intended to replace the previous markdown package. The rmarkdown package does not yet appear to be on CRAN, so install_github is necessary.
The best that worked for me is to quit Rstuido, then install rmarkdown package in the base R (not any IDE) and restarting Rstudio.
I am on Windows 10, R 3.3.1, Rstudio Version 0.99.903

Can't install package reshape2 for R 2.15.3 on Ubuntu 12.04.4

I am having trouble installing the reshape2 package for R 2.15.3 on Ubuntu 12.04.4 LTS. I decided not to upgrade to R 3.x because many of the packages that I use have not been upgraded to support the new version.
When I try to install reshape2 using R 2.15.3 on Ubuntu 12.04.4 LTS, I get the following.
> install.packages("reshape2")
Installing package(s) into â/usr/local/lib/R/site-libraryâ
(as âlibâ is unspecified)
Warning in install.packages("reshape2") :
'lib = "/usr/local/lib/R/site-library"' is not writable
Would you like to use a personal library instead? (y/n) y
Would you like to create a personal library
~/R/x86_64-pc-linux-gnu-library/2.15
to install packages into? (y/n) y
Warning: dependency âRcppâ is not available
also installing the dependencies âplyrâ, âstringrâ
trying URL 'http://cran.cs.wwu.edu/src/contrib/plyr_1.8.1.tar.gz'
Content type 'application/x-gzip' length 393233 bytes (384 Kb)
opened URL
==================================================
downloaded 384 Kb
trying URL 'http://cran.cs.wwu.edu/src/contrib/stringr_0.6.2.tar.gz'
Content type 'application/x-gzip' length 20636 bytes (20 Kb)
opened URL
==================================================
downloaded 20 Kb
trying URL 'http://cran.cs.wwu.edu/src/contrib/reshape2_1.2.2.tar.gz'
Content type 'application/x-gzip' length 27220 bytes (26 Kb)
opened URL
==================================================
downloaded 26 Kb
ERROR: dependency âRcppâ is not available for package âplyrâ
* removing â/home/ubuntu/R/x86_64-pc-linux-gnu-library/2.15/plyrâ
* installing *source* package âstringrâ ...
** package âstringrâ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (stringr)
ERROR: dependency âplyrâ is not available for package âreshape2â
* removing â/home/ubuntu/R/x86_64-pc-linux-gnu-library/2.15/reshape2â
The downloaded source packages are in
â/tmp/RtmpxP5OIc/downloaded_packagesâ
Warning messages:
1: In install.packages("reshape2") :
installation of package âplyrâ had non-zero exit status
2: In install.packages("reshape2") :
installation of package âreshape2â had non-zero exit status
>
I tried to then install the missing Rcpp but get the error message:
Warning message:
package âRcppâ is not available (for R version 2.15.3)
I searched some more and discovered that Rcpp now requires R version 3.x but that there is a RcppClassic version that is backwards compatible.
When trying to install RcppClassic, I get:
Installing package(s) into â/home/ubuntu/R/x86_64-pc-linux-gnu-library/2.15â
(as âlibâ is unspecified)
Warning: dependency âRcppâ is not available
trying URL 'http://cran.cs.wwu.edu/src/contrib/RcppClassic_0.9.5.tar.gz'
Content type 'application/x-gzip' length 185057 bytes (180 Kb)
opened URL
==================================================
downloaded 180 Kb
ERROR: dependency âRcppâ is not available for package âRcppClassicâ
* removing â/home/ubuntu/R/x86_64-pc-linux-gnu-library/2.15/RcppClassicâ
The downloaded source packages are in
â/tmp/RtmpxP5OIc/downloaded_packagesâ
Warning message:
In install.packages("RcppClassic") :
installation of package âRcppClassicâ had non-zero exit status
I then tried and was able to install Rcpp using "sudo apt-get install r-cran-rcpp":
$ sudo apt-get install r-cran-rcpp
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libgudev-1.0-0 gir1.2-gudev-1.0
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
littler r-cran-int64
Suggested packages:
r-cran-getopt r-cran-inline
The following NEW packages will be installed:
littler r-cran-int64 r-cran-rcpp
0 upgraded, 3 newly installed, 0 to remove and 3 not upgraded.
Need to get 2,899 kB of archives.
After this operation, 11.2 MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ precise/universe littler amd64 0.1.5-1 [32.2 kB]
Get:2 http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ precise/universe r-cran-int64 amd64 1.1.2-1 [359 kB]
Get:3 http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ precise/universe r-cran-rcpp amd64 0.9.9-1 [2,508 kB]
Fetched 2,899 kB in 0s (8,959 kB/s)
Selecting previously unselected package littler.
(Reading database ... 60157 files and directories currently installed.)
Unpacking littler (from .../littler_0.1.5-1_amd64.deb) ...
Selecting previously unselected package r-cran-int64.
Unpacking r-cran-int64 (from .../r-cran-int64_1.1.2-1_amd64.deb) ...
Selecting previously unselected package r-cran-rcpp.
Unpacking r-cran-rcpp (from .../r-cran-rcpp_0.9.9-1_amd64.deb) ...
Processing triggers for man-db ...
Setting up littler (0.1.5-1) ...
Setting up r-cran-int64 (1.1.2-1) ...
Setting up r-cran-rcpp (0.9.9-1) ...
But when I tried to install "reshape2" in R, I got the same error messages as before.
What I don't understand is why I'm getting the error message:
Warning: dependency âRcppâ is not available
Since 'sudo apt-get install r-cran-rcpp' worked
After some more searching, I found a vignette on how to use RcppClassic here: http://cran.r-project.org/web/packages/RcppClassic/vignettes/RcppClassic-intro.pdf
However, making modifications to the DESCRIPTION, NAMESPACE and MAKEVAR files is starting to go beyond my capabilities so I'm reaching out for help.
Here's the output from sessionInfo():
> sessionInfo()
R version 2.15.3 (2013-03-01)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=C LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
Thanks in advance!
EDIT 3/15/2014: My "use case" is that I'm running a series of periodic jobs on AWS EC2 instances so I don't need the latest/greatest software features. What I have using R 2.15 on my Mac development machine works so I was just looking to port what I have to my AWS EC2 Ubuntu instances.
The packages I use are: reshape2, xlsx (and xlsxjars), RJSONIO, stringr, R2HTML, RCurl, plots, lattice, latticeExtra, gdata and ggplot2.
A few things:
You insist on Ubuntu 12.04 LTS. A stable distribution. That is fine. Your choice. It also means you chose to freeze your software at a point a few months before April 2012.
Now you want something from CRAN. Something current. That is in conflict with the previous point.
Either you stay in distro. Or you become current.
Read the Ubuntu README and learn to how to stay with Ubuntu 12.04 yet at the same time get a current R package.
Install R 3.0.3 (current) via that repo.
Install the CRAN packages you want into /usr/local/lib/R/site-library.

Resources