error in install.package("phia") - r

I am running macOS High Sierra: 10.13.3 and RStudio: 1.1.383
I am trying to install the package "phia" to use the interactionMeans
I have tried changing my mirror to no avail
However, I get this error;
> install.packages("phia", repos="http://cran.r-project.org",
dependencies = T)
also installing the dependencies ‘rio’, ‘car’
There are binary versions available but the source versions are
later:
binary source needs_compilation
rio 0.5.5 0.5.10 FALSE
car 2.1-6 3.0-0 FALSE
trying URL 'http://cran.r-
project.org/bin/macosx/mavericks/contrib/3.3/phia_0.2-1.tgz'
Content type 'application/x-gzip' length 570570 bytes (557 KB)
==================================================
downloaded 557 KB
The downloaded binary packages are in /var/fo
lders/73/gmd2dyv53bq9z861m7x1v09h0000gn/T//Rtmp23hrdR/downloaded_pa
ckages
installing the source packages ‘rio’, ‘car’
trying URL 'http://cran.r-project.org/src/contrib/rio_0.5.10.tar.gz'
Content type 'application/x-gzip' length 70117 bytes (68 KB)
==================================================
downloaded 68 KB
trying URL 'http://cran.r-project.org/src/contrib/car_3.0-0.tar.gz'
Content type 'application/x-gzip' length 443887 bytes (433 KB)
==================================================
downloaded 433 KB
* installing *source* package ‘rio’ ...
** package ‘rio’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
Error : object ‘read_xls’ is not exported by 'namespace:readxl'
ERROR: lazy loading failed for package ‘rio’
* removing
‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rio’
Warning in install.packages :
installation of package ‘rio’ had non-zero exit status
ERROR: dependency ‘rio’ is not available for package ‘car’
* removing
‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/car’
Warning in install.packages :
installation of package ‘car’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/73/gmd2dyv53bq9z861m7x1v09h0000gn/T/Rtmp23hrdR/downloaded_packages’
If anyone has any ideas please fire them at me!

Related

How can install bestNormalize package for R?

install.packages("bestNormalize")
devtools::install_github("petersonR/bestNormalize")
I am trying to install the bestNormalize package for R, but i have the following ERROR:
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/Alex/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
also installing the dependencies ‘tibble’, ‘cli’, ‘clock’, ‘hardhat’, ‘lifecycle’, ‘rlang’, ‘tidyselect’, ‘vctrs’, ‘recipes’
There are binary versions available but the source versions are later:
binary source needs_compilation
tibble 3.1.6 3.1.8 TRUE
cli 3.2.0 3.6.0 TRUE
clock 0.6.0 0.6.1 TRUE
hardhat 0.2.0 1.2.0 FALSE
lifecycle 1.0.1 1.0.3 FALSE
rlang 1.0.2 1.0.6 TRUE
tidyselect 1.1.2 1.2.0 FALSE
vctrs 0.4.1 0.5.2 TRUE
recipes 0.2.0 1.0.4 FALSE
bestNormalize 1.8.2 1.8.3 FALSE
Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/tibble_3.1.6.zip'
Content type 'application/zip' length 872395 bytes (851 KB)
downloaded 851 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/cli_3.2.0.zip'
Content type 'application/zip' length 1255499 bytes (1.2 MB)
downloaded 1.2 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/clock_0.6.0.zip'
Content type 'application/zip' length 3387600 bytes (3.2 MB)
downloaded 3.2 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/rlang_1.0.2.zip'
Content type 'application/zip' length 1718546 bytes (1.6 MB)
downloaded 1.6 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/vctrs_0.4.1.zip'
Content type 'application/zip' length 1569486 bytes (1.5 MB)
downloaded 1.5 MB
package ‘tibble’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot remove prior installation of package ‘tibble’
Warning in install.packages :
problem copying C:\Users\Alex\Documents\R\win-library\4.0\00LOCK\tibble\libs\x64\tibble.dll to C:\Users\Alex\Documents\R\win-library\4.0\tibble\libs\x64\tibble.dll: Permission denied
Warning in install.packages :
restored ‘tibble’
package ‘cli’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot remove prior installation of package ‘cli’
Warning in install.packages :
problem copying C:\Users\Alex\Documents\R\win-library\4.0\00LOCK\cli\libs\x64\cli.dll to C:\Users\Alex\Documents\R\win-library\4.0\cli\libs\x64\cli.dll: Permission denied
Warning in install.packages :
restored ‘cli’
package ‘clock’ successfully unpacked and MD5 sums checked
package ‘rlang’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot remove prior installation of package ‘rlang’
Warning in install.packages :
problem copying C:\Users\Alex\Documents\R\win-library\4.0\00LOCK\rlang\libs\x64\rlang.dll to C:\Users\Alex\Documents\R\win-library\4.0\rlang\libs\x64\rlang.dll: Permission denied
Warning in install.packages :
restored ‘rlang’
package ‘vctrs’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot remove prior installation of package ‘vctrs’
Warning in install.packages :
problem copying C:\Users\Alex\Documents\R\win-library\4.0\00LOCK\vctrs\libs\x64\vctrs.dll to C:\Users\Alex\Documents\R\win-library\4.0\vctrs\libs\x64\vctrs.dll: Permission denied
Warning in install.packages :
restored ‘vctrs’
The downloaded binary packages are in
C:\Users\Alex\AppData\Local\Temp\Rtmp8YzMvr\downloaded_packages
installing the source packages ‘hardhat’, ‘lifecycle’, ‘tidyselect’, ‘recipes’, ‘bestNormalize’
trying URL 'https://cran.rstudio.com/src/contrib/hardhat_1.2.0.tar.gz'
Content type 'application/x-gzip' length 953223 bytes (930 KB)
downloaded 930 KB
trying URL 'https://cran.rstudio.com/src/contrib/lifecycle_1.0.3.tar.gz'
Content type 'application/x-gzip' length 106854 bytes (104 KB)
downloaded 104 KB
trying URL 'https://cran.rstudio.com/src/contrib/tidyselect_1.2.0.tar.gz'
Content type 'application/x-gzip' length 101498 bytes (99 KB)
downloaded 99 KB
trying URL 'https://cran.rstudio.com/src/contrib/recipes_1.0.4.tar.gz'
Content type 'application/x-gzip' length 801878 bytes (783 KB)
downloaded 783 KB
trying URL 'https://cran.rstudio.com/src/contrib/bestNormalize_1.8.3.tar.gz'
Content type 'application/x-gzip' length 1129792 bytes (1.1 MB)
downloaded 1.1 MB
installing source package 'hardhat' ...
package 'hardhat' successfully unpacked and MD5 sums checked
using staged installation
R
data
moving datasets to lazyload DB
inst
byte-compile and prepare package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
namespace 'rlang' 1.0.2 is being loaded, but >= 1.0.3 is required
Calls: ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace
Ejecución interrumpida
ERROR: lazy loading failed for package 'hardhat'
removing 'C:/Users/Alex/Documents/R/win-library/4.0/hardhat'
Warning in install.packages :
installation of package ‘hardhat’ had non-zero exit status
installing source package 'lifecycle' ...
package 'lifecycle' successfully unpacked and MD5 sums checked
ERROR: cannot remove earlier installation, is it in use?
removing 'C:/Users/Alex/Documents/R/win-library/4.0/lifecycle'
restoring previous 'C:/Users/Alex/Documents/R/win-library/4.0/lifecycle'
Warning in install.packages :
installation of package ‘lifecycle’ had non-zero exit status
installing source package 'tidyselect' ...
package 'tidyselect' successfully unpacked and MD5 sums checked
ERROR: cannot remove earlier installation, is it in use?
removing 'C:/Users/Alex/Documents/R/win-library/4.0/tidyselect'
restoring previous 'C:/Users/Alex/Documents/R/win-library/4.0/tidyselect'
Warning in install.packages :
installation of package ‘tidyselect’ had non-zero exit status
ERROR: dependency 'hardhat' is not available for package 'recipes'
removing 'C:/Users/Alex/Documents/R/win-library/4.0/recipes'
Warning in install.packages :
installation of package ‘recipes’ had non-zero exit status
Warning in read.dcf(file.path(p, "DESCRIPTION"), c("Package", "Version")) :
cannot open file 'C:/Users/Alex/Documents/R/win-library/4.0/recipes/DESCRIPTION': it is a directory
ERROR: dependency 'recipes' is not available for package 'bestNormalize'
removing 'C:/Users/Alex/Documents/R/win-library/4.0/bestNormalize'
Warning in install.packages :
installation of package ‘bestNormalize’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\Alex\AppData\Local\Temp\Rtmp8YzMvr\downloaded_packages’
Warning message:
In readLines(file, skipNul = TRUE) :
cannot open file 'C:/Users/Alex/Documents/R/win-library/4.0/recipes/DESCRIPTION': it is a directory
I would like to install bestNormalized!
Many thanks

Unable to install tmap

Tried to install the tmap package but encounter the below error
install.packages("tmap")
also installing the dependencies ‘tmaptools’, ‘sf’, ‘stars’, ‘classInt’
There are binary versions available but the source versions are later:
binary source needs_compilation
tmaptools 2.0-2 3.1 FALSE
sf 0.8-1 0.9-5 TRUE
stars 0.4-0 0.4-3 FALSE
classInt 0.4-2 0.4-3 TRUE
tmap 2.3-2 3.1 FALSE
Do you want to install from sources the packages which need compilation? (Yes/no/cancel) no
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/sf_0.8-1.tgz'
Content type 'application/x-gzip' length 53770407 bytes (51.3 MB)
==================================================
downloaded 51.3 MB
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/classInt_0.4-2.tgz'
Content type 'application/x-gzip' length 77560 bytes (75 KB)
==================================================
downloaded 75 KB
The downloaded binary packages are in
/var/folders/60/16nrd6w13g33nq3dpr441mgc0000gn/T//RtmphtcoT4/downloaded_packages
installing the source packages ‘tmaptools’, ‘stars’, ‘tmap’
trying URL 'https://cran.rstudio.com/src/contrib/tmaptools_3.1.tar.gz'
Content type 'application/x-gzip' length 39932 bytes (38 KB)
==================================================
downloaded 38 KB
trying URL 'https://cran.rstudio.com/src/contrib/stars_0.4-3.tar.gz'
Content type 'application/x-gzip' length 4745035 bytes (4.5 MB)
==================================================
downloaded 4.5 MB
trying URL 'https://cran.rstudio.com/src/contrib/tmap_3.1.tar.gz'
Content type 'application/x-gzip' length 2948495 bytes (2.8 MB)
==================================================
downloaded 2.8 MB
* installing *source* package ‘stars’ ...
** package ‘stars’ successfully unpacked and MD5 sums checked
** R
** demo
** inst
** byte-compile and prepare package for lazy loading
Error : package ‘sf’ 0.8.1 was found, but >= 0.9.0 is required by ‘stars’
ERROR: lazy loading failed for package ‘stars’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/stars’
Warning in install.packages :
installation of package ‘stars’ had non-zero exit status
ERROR: dependency ‘stars’ is not available for package ‘tmaptools’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/tmaptools’
Warning in install.packages :
installation of package ‘tmaptools’ had non-zero exit status
ERROR: dependencies ‘tmaptools’, ‘stars’ are not available for package ‘tmap’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/tmap’
Warning in install.packages :
installation of package ‘tmap’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/60/16nrd6w13g33nq3dpr441mgc0000gn/T/RtmphtcoT4/downloaded_packages’
Issue solved by reinstalled R to the latest version

RMD packages can't be downloaded in R Studio

I can't download the RMD packages in R studio. I tried it by running install.packages("rmarkdown"), and I tried it by File > New File > R Markdown > Download packages.
This is the output:
> install.packages("rmarkdown")
Installing package into ‘C:/Users/Luke/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
also installing the dependencies ‘glue’, ‘stringi’, ‘knitr’, ‘yaml’, ‘stringr’
There are binary versions available but the source versions are later:
binary source needs_compilation
glue 1.0.0 1.3.1 TRUE
stringi 1.1.5 1.4.3 TRUE
knitr 1.15.1 1.23 FALSE
yaml 2.1.14 2.2.0 TRUE
stringr 1.2.0 1.4.0 FALSE
rmarkdown 1.4 1.13 FALSE
Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/glue_1.0.0.zip'
Content type 'application/zip' length 34947 bytes (34 KB)
downloaded 34 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/stringi_1.1.5.zip'
Content type 'application/zip' length 14220135 bytes (13.6 MB)
downloaded 13.6 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/yaml_2.1.14.zip'
Content type 'application/zip' length 180051 bytes (175 KB)
downloaded 175 KB
package ‘glue’ successfully unpacked and MD5 sums checked
package ‘stringi’ successfully unpacked and MD5 sums checked
package ‘yaml’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Luke\AppData\Local\Temp\Rtmpq6rTgq\downloaded_packages
installing the source packages ‘knitr’, ‘stringr’, ‘rmarkdown’
trying URL 'https://cran.rstudio.com/src/contrib/knitr_1.23.tar.gz'
Content type 'application/x-gzip' length 880134 bytes (859 KB)
downloaded 859 KB
trying URL 'https://cran.rstudio.com/src/contrib/stringr_1.4.0.tar.gz'
Content type 'application/x-gzip' length 135777 bytes (132 KB)
downloaded 132 KB
trying URL 'https://cran.rstudio.com/src/contrib/rmarkdown_1.13.tar.gz'
Content type 'application/x-gzip' length 3155180 bytes (3.0 MB)
downloaded 3.0 MB
* installing *source* package 'stringr' ...
** package 'stringr' successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
namespace 'stringi' 1.1.5 is being loaded, but >= 1.1.7 is required
ERROR: lazy loading failed for package 'stringr'
* removing 'C:/Users/Luke/Documents/R/win-library/3.2/stringr'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-32~1.3/bin/i386/R" CMD INSTALL -l "C:\Users\Luke\Documents\R\win-library\3.2" C:\Users\Luke\AppData\Local\Temp\Rtmpq6rTgq/downloaded_packages/stringr_1.4.0.tar.gz' had status 1
Warning in install.packages :
installation of package ‘stringr’ had non-zero exit status
ERROR: dependency 'stringr' is not available for package 'knitr'
* removing 'C:/Users/Luke/Documents/R/win-library/3.2/knitr'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-32~1.3/bin/i386/R" CMD INSTALL -l "C:\Users\Luke\Documents\R\win-library\3.2" C:\Users\Luke\AppData\Local\Temp\Rtmpq6rTgq/downloaded_packages/knitr_1.23.tar.gz' had status 1
Warning in install.packages :
installation of package ‘knitr’ had non-zero exit status
ERROR: dependencies 'knitr', 'stringr' are not available for package 'rmarkdown'
* removing 'C:/Users/Luke/Documents/R/win-library/3.2/rmarkdown'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-32~1.3/bin/i386/R" CMD INSTALL -l "C:\Users\Luke\Documents\R\win-library\3.2" C:\Users\Luke\AppData\Local\Temp\Rtmpq6rTgq/downloaded_packages/rmarkdown_1.13.tar.gz' had status 1
Warning in install.packages :
installation of package ‘rmarkdown’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\Luke\AppData\Local\Temp\Rtmpq6rTgq\downloaded_packages’
The C:\Users\Luke\AppData\Local\Temp\Rtmpq6rTgq\downloaded_packages folder contains:
Screenshot of named folder
I am very inexperienced with programming in R, so I have no idea what to do with this. I am learning to do it (via the online Udacity course), and for that I need these RMD packages to continue. I hope someone can help me.

car package in Ubuntu machine 16.04

I can't install car package in R in an Ubuntu VM 16.04.
My last attempt was through terminal console of R.
The same result when I try to run it through R studio or using devtools
I receive the following errors:
> install.packages('car')
Installing package into ‘/home/stefan/R/x86_64-pc-linux-gnu-library/3.2’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
also installing the dependencies ‘nloptr’, ‘lme4’, ‘pbkrtest’
trying URL 'https://ftp.cc.uoc.gr/mirrors/CRAN/src/contrib/nloptr_1.0.4.tar.gz'
Content type 'application/octet-stream' length 353957 bytes (345 KB)
==================================================
downloaded 345 KB
trying URL 'https://ftp.cc.uoc.gr/mirrors/CRAN/src/contrib/lme4_1.1-15.tar.gz'
Content type 'application/octet-stream' length 3610706 bytes (3.4 MB)
==================================================
downloaded 3.4 MB
trying URL 'https://ftp.cc.uoc.gr/mirrors/CRAN/src/contrib/pbkrtest_0.4-7.tar.gz'
Content type 'application/octet-stream' length 156406 bytes (152 KB)
==================================================
downloaded 152 KB
trying URL 'https://ftp.cc.uoc.gr/mirrors/CRAN/src/contrib/car_2.1-6.tar.gz'
Content type 'application/octet-stream' length 627349 bytes (612 KB)
==================================================
downloaded 612 KB
ERROR: failed to lock directory ‘/home/stefan/R/x86_64-pc-linux-gnu-library/3.2’ for modifying
Try removing ‘/home/stefan/R/x86_64-pc-linux-gnu-library/3.2/00LOCK-nloptr’
ERROR: dependency ‘nloptr’ is not available for package ‘lme4’
* removing ‘/home/stefan/R/x86_64-pc-linux-gnu-library/3.2/lme4’
ERROR: dependency ‘lme4’ is not available for package ‘pbkrtest’
* removing ‘/home/stefan/R/x86_64-pc-linux-gnu-library/3.2/pbkrtest’
ERROR: dependency ‘pbkrtest’ is not available for package ‘car’
* removing ‘/home/stefan/R/x86_64-pc-linux-gnu-library/3.2/car’
The downloaded source packages are in
‘/tmp/RtmpXR2ZjI/downloaded_packages’
Warning messages:
1: In install.packages("car") :
installation of package ‘nloptr’ had non-zero exit status
2: In install.packages("car") :
installation of package ‘lme4’ had non-zero exit status
3: In install.packages("car") :
installation of package ‘pbkrtest’ had non-zero exit status
4: In install.packages("car") :
installation of package ‘car’ had non-zero exit status

How to install packages in R or Rstudio

when trying to install a package:
> install.packages("mlr")
Installing package into ‘/home/kisco/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
Warning in install.packages :
dependencies ‘plyr’, ‘dplyr’, ‘lazyeval’ are not available
also installing the dependencies ‘scales’, ‘ggplot2’, ‘ggvis’, ‘reshape2’
trying URL 'http://cran.rstudio.com/src/contrib/scales_0.2.5.tar.gz'
Content type 'application/x-gzip' length 56346 bytes (55 Kb)
opened URL
==================================================
downloaded 55 Kb
trying URL 'http://cran.rstudio.com/src/contrib/ggplot2_1.0.1.tar.gz'
Content type 'application/x-gzip' length 2351203 bytes (2.2 Mb)
opened URL
==================================================
downloaded 2.2 Mb
trying URL 'http://cran.rstudio.com/src/contrib/ggvis_0.4.2.tar.gz'
Content type 'application/x-gzip' length 728345 bytes (711 Kb)
opened URL
==================================================
downloaded 711 Kb
trying URL 'http://cran.rstudio.com/src/contrib/reshape2_1.4.1.tar.gz'
Content type 'application/x-gzip' length 34693 bytes (33 Kb)
opened URL
==================================================
downloaded 33 Kb
trying URL 'http://cran.rstudio.com/src/contrib/mlr_2.4.tar.gz'
Content type 'application/x-gzip' length 440988 bytes (430 Kb)
opened URL
==================================================
downloaded 430 Kb
ERROR: dependency ‘plyr’ is not available for package ‘scales’
* removing ‘/home/kisco/R/x86_64-pc-linux-gnu-library/3.0/scales’
Warning in install.packages :
installation of package ‘scales’ had non-zero exit status
ERROR: dependencies ‘dplyr’, ‘lazyeval’ are not available for package ‘ggvis’
* removing ‘/home/kisco/R/x86_64-pc-linux-gnu-library/3.0/ggvis’
Warning in install.packages :
installation of package ‘ggvis’ had non-zero exit status
ERROR: dependency ‘plyr’ is not available for package ‘reshape2’
* removing ‘/home/kisco/R/x86_64-pc-linux-gnu-library/3.0/reshape2’
Warning in install.packages :
installation of package ‘reshape2’ had non-zero exit status
ERROR: dependencies ‘plyr’, ‘reshape2’, ‘scales’ are not available for package ‘ggplot2’
* removing ‘/home/kisco/R/x86_64-pc-linux-gnu-library/3.0/ggplot2’
Warning in install.packages :
installation of package ‘ggplot2’ had non-zero exit status
ERROR: dependencies ‘ggplot2’, ‘ggvis’, ‘plyr’, ‘reshape2’ are not available for package ‘mlr’
removing ‘/home/kisco/R/x86_64-pc-linux-gnu-library/3.0/mlr’
Warning in install.packages :
installation of package ‘mlr’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmp3AjleG/downloaded_packages’
I keep getting th eerror" warning in install.packages insallation of package ... had non zero exit status.
What am I doing wrong? How do I Install MLR?
You have an outdated version of R. Normally dplyr and your other dependencies would be automatically installed, but in this case they are labelled as not working with older versions of R, so throw an error.
You have version 3.0.2, which is out of date. As of now the current version is 3.2.1. You should upgrade (you don't have the most up to date version of r-base, repos are often behind - try getting the binary from here).
If you don't want to update you can use the methods described in answers to this question to install older versions of the packages which may be compatible with your version - install older version of R package.

Resources