I need devtools because I need the function install_github to install the non-CRAN package digitize here.
I installed R
by
sudo apt-get install r-cran-robustbase
I did not install R's packages right away, as terdon's answer proposes, but I could correct the permissions:
sudo chmod 755 /usr/lib/R/site-library/
which I think is the default setting.
I then had to do as rcs' answer proposes, to successfully install devtools
and tpoisot/digitize
but only with
sudo apt-get install libssl-dev
sudo apt-get install libcurl4-openssl-dev
R
install.packages('httr')
install.packages('git2r')
install.packages('devtools')
library(devtools)
install.packages('readbitmap')
install_github('tpoisot/digitize')
The output of the last command can be
Skipping install for github remote, the SHA1 (d16e28b9) has not changed since last install.
Use `force = TRUE` to force installation
Do install_github('tpoisot/digitize', force = TRUE)
but you may get
...
'/usr/lib/R/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet \
CMD INSTALL '/tmp/RtmpX8eOLX/devtools57475d25a113/tpoisot-digitize-d16e28b' \
--library='/usr/local/lib/R/site-library' --install-tests
Error: ERROR: no permission to install to directory ‘/usr/local/lib/R/site-library’
Error: Command failed (1)
I could not find a way to install digitize without sudo
. So do sudo R
, and repeat the same and you get
...
'/usr/lib/R/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet \
CMD INSTALL '/tmp/RtmpAlAT4e/devtools57e864e8c490/tpoisot-digitize-d16e28b' \
--library='/usr/local/lib/R/site-library' --install-tests
* installing *source* package ‘digitize’ ...
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (digitize)
Add masi
to the existing group staff
to work without sudo
in R
; which you need also in a fresh installation
sudo usermod -a -G staff masi
Tests of the installation
-
I follow the guide here. I start
R
in$HOME/Pictures/
withoutsudo
and use their test image here. -
Select four points in the axes with mouse
cal = digitize::ReadAndCal('Rintro-snail1.jpg')
- Do
data.points = digitize::DigitData(col = 'red')
and choose manually points which are your data points
-
I close the Plot window by doing second-click.
-
Do
df = digitize::Calibrate(data.points, cal, 0.1, 0.4, 0.0, 0.6)
and seeingdf
x y 1 71.50 NA 2 65.65 NA ... 24 26.80 NA
Doing
head(df)
x y 1 71.50 NA 2 65.65 NA 3 64.60 NA 4 60.85 NA 5 59.05 NA 6 58.15 NA
Installation Details
-
In
R
and withoutsudo
> .Library [1] "/usr/lib/R/library" > > .libPaths() [1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library" [3] "/usr/lib/R/library"
-
Command
ls /usr/lib/R/library/
which does not listdevtools
. Why?base compiler grid methods rpart survival boot datasets KernSmooth mgcv spatial tcltk class foreign lattice nlme splines tools cluster graphics MASS nnet stats translations codetools grDevices Matrix parallel stats4 utils
-
Command
ls -la /usr/local/lib/R/
total 12 drwxrwsr-x 3 root staff 4096 touko 19 22:25 . drwxr-xr-x 5 root root 4096 touko 19 22:25 .. drwxrwsr-x 2 root staff 4096 touko 19 22:25 site-library
-
Command
ls -la /usr/local/lib/
total 20 drwxr-xr-x 5 root root 4096 touko 19 22:25 . drwxr-xr-x 14 root root 4096 touko 19 22:13 .. drwxrwsr-x 4 root staff 4096 huhti 21 01:13 python2.7 drwxrwsr-x 3 root staff 4096 huhti 21 01:08 python3.5 drwxrwsr-x 3 root staff 4096 touko 19 22:25 R
-
Command
R_LIBS_USER="/usr/local/lib/R/site-library/" R
R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" Copyright (C) 2015 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) ...
-
library(devtools)
gets loaded
Differential tools
- This project is more popular and can work better https://github.com/markummitchell/engauge-digitizer
Reasons for previous bugs
- No clean system: systems which were upgraded from 14.04, 15.10, etc.
- Messed up permissions/owners because of the previous thing.
- Own mistakes in the process.
- No backups in the case of failure.
- …
- missing docs
System: Ubuntu 16.04 64 bit in a clean installation
Hardware: Dell PC 2013, Macbook Air 2013-mid, …
Best Answer
httr
imports theopenssl
package which needs as system requirementlibssl-dev
(sudo apt install libssl-dev
)The
curl
package needs as system requirementlibcurl4-openssl-dev
:So, to install you will need to run:
Then start an R shell with
sudo R
and: