Error while Installing SpatialPosition Package in Azure jupyter notebook - r

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

Related

error using the 'digest' package in R

I recently had some problems installing and using the package "digest" in R-3.4.3, which I used previously in R-3.4.1 with no problem. Below are the messages I received from R.
install.packages("digest", dependencies = TRUE)
trying URL 'https://mirror.aarnet.edu.au/pub/CRAN/bin/windows/contrib/3.4/digest_0.6.15.zip'
Content type 'application/zip' length 175238 bytes (171 KB)
downloaded 171 KB
package ‘digest’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\weizha\AppData\Local\Temp\RtmpwhNFrq\downloaded_packages
library(digest)
Error: package or namespace load failed for ‘digest’ in FUN(X[[i]], ...):
no such symbol digest in package E:/R 3.4.3/library/digest/libs/x64/digest.dll
Previously I used install.packages(devtools) in R-3.4.1 which installs "digest" as well, and it all worked fine. Recently work upgraded our operating system to windows 10 (from 7) and installed R-3.4.3 for us, and I couldn't get devtools to work anymore, I figured out it's because digest is not working as has been shown above. I've read everything I can find online, but I have no clue how to fix this.
> .libPaths()
[1] "E:/R-3.4.3/library"
> install.packages("digest", lib="E:/R-3.4.3/library")
--- Please select a CRAN mirror for use in this session ---
trying URL 'https://cran.csiro.au/bin/windows/contrib/3.4/digest_0.6.15.zip'
Content type 'application/zip' length 175238 bytes (171 KB)
downloaded 171 KB
package ‘digest’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\weizha\AppData\Local\Temp\RtmpCQY8o1\downloaded_packages
> library(digest)
Error: package or namespace load failed for ‘digest’ in FUN(X[[i]], ...):
no such symbol digest in package E:/R-3.4.3/library/digest/libs/x64/digest.dll
> library("digest", lib.loc="E:/R-3.4.3/library")
Error: package or namespace load failed for ‘digest’ in FUN(X[[i]], ...):
no such symbol digest in package E:/R-3.4.3/library/digest/libs/x64/digest.dll
> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 14393)
Matrix products: default
locale:
[1] LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252
[3] LC_MONETARY=English_Australia.1252 LC_NUMERIC=C
[5] LC_TIME=English_Australia.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.4.3 tools_3.4.3
>
> setwd('E:/R-3.4.3')
> install.packages("digest", type="source")
trying URL 'https://cran.csiro.au/src/contrib/digest_0.6.15.tar.gz'
Content type 'application/x-gzip' length 122095 bytes (119 KB)
downloaded 119 KB
* installing *source* package 'digest' ...
** package 'digest' successfully unpacked and MD5 sums checked
** libs
Warning: running command 'make -f "E:/R-34~1.3/etc/x64/Makeconf" -f "E:/R-34~1.3/share/make/winshlib.mk" SHLIB="digest.dll" WIN=64 TCLBIN=64 OBJECTS="aes.o crc32.o digest.o init.o md5.o pmurhash.o raes.o sha1.o sha2.o sha256.o xxhash.o"' had status 127
ERROR: compilation failed for package 'digest'
* removing 'E:/R-3.4.3/library/digest'
In R CMD INSTALL
The downloaded source packages are in
‘C:\Users\weizha\AppData\Local\Temp\RtmpCQY8o1\downloaded_packages’
Warning messages:
1: running command '"E:/R-3.4.3/bin/x64/R" CMD INSTALL -l "E:\R-3.4.3\library" C:\Users\weizha\AppData\Local\Temp\RtmpCQY8o1/downloaded_packages/digest_0.6.15.tar.gz' had status 1
2: In install.packages("digest", type = "source") :
installation of package ‘digest’ had non-zero exit status
> .libPaths()
[1] "E:/R-3.4.3/library"
> install.packages("digest", type="binary")
--- Please select a CRAN mirror for use in this session ---
trying URL 'https://cran.csiro.au/bin/windows/contrib/3.4/digest_0.6.15.zip'
Content type 'application/zip' length 175238 bytes (171 KB)
downloaded 171 KB
package ‘digest’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\weizha\AppData\Local\Temp\Rtmp0UupHr\downloaded_packages
> library(digest)
Error: package or namespace load failed for ‘digest’ in FUN(X[[i]], ...):
no such symbol digest in package E:/R-3.4.3/library/digest/libs/x64/digest.dll
When I manually download the package from CRAN, this is what I received from R
> .libPaths()
[1] "E:/R-3.4.3/library"
> library(digest)
Error: package ‘digest’ was installed by an R version with different internals; it needs to be reinstalled for use with this R version
In addition: Warning message:
package ‘digest’ was built under R version 3.5.0
>

install.packages(...) fails on Windows 10

I am trying to install the dplyr package from Visual Studio 2017. It has a dependency on pillar.
When I perform an install from the command line, I get:
> install.packages('pillar')
Installing package into ‘C:/Users/Jérôme Verstrynge/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
pillar 1.2.1 1.2.2 FALSE
installing the source package ‘pillar’
trying URL 'http://cran.r-project.org/src/contrib/pillar_1.2.2.tar.gz'
Content type 'application/x-gzip' length 64185 bytes (62 KB)
downloaded 62 KB
* installing *source* package 'pillar' ...
** package 'pillar' successfully unpacked and MD5 sums checked
Warning in file(file, if (append) "a" else "w") :
cannot open file 'C:/Users/Jirtme Verstrynge/Documents/R/win-library/3.3/pillar/DESCRIPTION': No such file or directory
Error in file(file, if (append) "a" else "w") :
cannot open the connection
ERROR: installing package DESCRIPTION failed for package 'pillar'
* removing 'C:/Users/Jérôme Verstrynge/Documents/R/win-library/3.3/pillar'
There is a bogus conversion of Jérôme Verstrynge into Jirtme Verstrynge.
How can I work around this?
More information
When I perform Get-WinSystemLocale from Windows 10 PowerShell, I get:
LCID Name DisplayName
---- ---- -----------
2057 en-GB English (United Kingdom)
Sys.getlocale() returns:
[1] "LC_COLLATE=English_United Kingdom.1252;
LC_CTYPE=English_United Kingdom.1252;
LC_MONETARY=English_United Kingdom.1252;
LC_NUMERIC=C;
LC_TIME=English_United Kingdom.1252"
Workaround
I have uninstalled Microsoft R client and reinstalled it from here. The client is now on version 3.4.3.0.
The issue has disappeared for the package pillar, but it is coming back with a package called dendextend while trying to install.packages('seriation').
The error is:
> install.packages('seriation')
Installing package into ‘C:/Users/Jérôme Verstrynge/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependency ‘dendextend’
There is a binary version available but the source version is later:
binary source needs_compilation
dendextend 1.7.0 1.8.0 FALSE
trying URL 'http://cran.r-project.org/bin/windows/contrib/3.4/seriation_1.2-3.zip'
Content type 'application/zip' length 1015954 bytes (992 KB)
downloaded 992 KB
package ‘seriation’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Temp\Rtmpi2lOd8\downloaded_packages
installing the source package ‘dendextend’
trying URL 'http://cran.r-project.org/src/contrib/dendextend_1.8.0.tar.gz'
Content type 'application/x-gzip' length 1758392 bytes (1.7 MB)
downloaded 1.7 MB
* installing *source* package 'dendextend' ...
** package 'dendextend' successfully unpacked and MD5 sums checked
Warning in file(file, if (append) "a" else "w") :
cannot open file 'C:/Users/Jirtme Verstrynge/Documents/R/win-library/3.4/dendextend/DESCRIPTION': No such file or directory
Error in file(file, if (append) "a" else "w") :
cannot open the connection
ERROR: installing package DESCRIPTION failed for package 'dendextend'
* removing 'C:/Users/Jérôme Verstrynge/Documents/R/win-library/3.4/dendextend'
In R CMD INSTALL
The downloaded source packages are in
‘C:\Temp\Rtmpi2lOd8\downloaded_packages’
Warning messages:
1: running command '"C:/PROGRA~1/MIE74D~1/RCLIEN~1/R_SERVER/bin/x64/R" CMD INSTALL -l "C:\Users\Jérôme Verstrynge\Documents\R\win-library\3.4" C:\Temp\Rtmpi2lOd8/downloaded_packages/dendextend_1.8.0.tar.gz' had status 1
2: In utils::install.packages(...) :
installation of package ‘dendextend’ had non-zero exit status
>
It seems there is an issue in utils::install.packages(...)
Issue solved
Apparently, on top of re-installing Microsoft R Client, the remaining issue was related to missing binary packages not available on CRAN repositories yet.
I doubt this has anything to do with the pillar package, but perhaps with the fact that this package is installed from source (unlike the default which is to install from binary). This problem will eventually resolve itself as the binary version of pillar 1.2.2 becomes available on your CRAN mirror (it's already there on CRAN and on https://cloud.r-project.org/web/packages/pillar/index.html).
What's the value of getOption("repos") on your system?
The mis-encoding of non-ASCII characters in this particular scenario feels like a problem which is best avoided by choosing an ASCII-only and space-free directory name for your home (e.g. C:\Users\jverstry instead of your current setting). To rule out a problem with Visual Studio, you could try installing the package from RGui or from the R terminal, please double-check that the installation path for the package is the same.

Why R packages are removed after updating them?

I was trying to update some R packages since RStudio showed they could be updated. After updating, two packages are simply removed. (rgdal and spatstat). The same thing has happened several times recently. What is happening here?
> install.packages(c("data.table", "rgdal", "spatstat"))
Installing packages into ‘C:/Users/Patrick/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependency ‘spatstat.data’
There is a binary version available but the source version is later:
binary source needs_compilation
spatstat.data 1.1-0 1.1-1 FALSE
trying URL 'https://mirror.las.iastate.edu/CRAN/bin/windows/contrib/3.4/data.table_1.10.4-1.zip'
Content type 'application/zip' length 1577319 bytes (1.5 MB)
downloaded 1.5 MB
trying URL 'https://mirror.las.iastate.edu/CRAN/bin/windows/contrib/3.4/rgdal_1.2-13.zip'
Content type 'application/zip' length 30475771 bytes (29.1 MB)
downloaded 29.1 MB
trying URL 'https://mirror.las.iastate.edu/CRAN/bin/windows/contrib/3.4/spatstat_1.53-2.zip'
Content type 'application/zip' length 14521163 bytes (13.8 MB)
downloaded 13.8 MB
package ‘data.table’ successfully unpacked and MD5 sums checked
package ‘rgdal’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot remove prior installation of package ‘rgdal’
package ‘spatstat’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot remove prior installation of package ‘spatstat’
The downloaded binary packages are in
C:\Users\Patrick\AppData\Local\Temp\RtmpeaKi0Y\downloaded_packages
installing the source package ‘spatstat.data’
trying URL 'https://mirror.las.iastate.edu/CRAN/src/contrib/spatstat.data_1.1-1.tar.gz'
Content type 'application/x-gzip' length 2837063 bytes (2.7 MB)
downloaded 2.7 MB
* installing *source* package 'spatstat.data' ...
** package 'spatstat.data' successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* DONE (spatstat.data)
The downloaded source packages are in
‘C:\Users\Patrick\AppData\Local\Temp\RtmpeaKi0Y\downloaded_packages’
> library(rgdal)
Error in library(rgdal) : there is no package called ‘rgdal’
> library(spatstat)
Error in library(spatstat) : there is no package called ‘spatstat’
You can find the directory that contains your installed packages with
.libPaths()
Which should give you something like:
"/Library/Frameworks/R.framework/Versions/3.3/Resources/library"
If you see rgdal or spatstat there I would delete them and then try installing again.

RMongo installation fails with Segmentation Fault in Ubuntu

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

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