简体   繁体   中英

sjPlot installation and rlang error in R

I've spent all day trying to install sjPlot and I've been searching the forum + other forums but can't seem to find a solution to my problem. Essentially, when I try to install the sjPlot package, I get the following output:

> install.packages("sjPlot", dependencies = TRUE)
Installing package into ‘C:/Users/mmarttin/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
  dependencies ‘VGAM’, ‘pbkrtest’ are not available
also installing the dependencies ‘bindrcpp’, ‘glue’, ‘purrr’, ‘bayesplot’, ‘pillar’, ‘dplyr’, ‘ggeffects’, ‘rlang’, ‘sjlabelled’, ‘sjmisc’, ‘sjstats’, ‘tidyselect’, ‘tibble’, ‘tidyr’, ‘AICcmodavg’, ‘car’


> There are binary versions available but the source versions are later:
           binary source needs_compilation
bindrcpp      0.1    0.2              TRUE
glue        1.0.0  1.2.0              TRUE
purrr       0.2.2  0.2.4              TRUE
bayesplot   1.2.0  1.4.0             FALSE
dplyr       0.5.0  0.7.4              TRUE
sjmisc      2.4.0  2.6.3             FALSE
sjstats    0.10.0 0.14.0             FALSE
tibble      1.3.0  1.4.2              TRUE
tidyr       0.6.1  0.7.2              TRUE
AICcmodavg  2.1-0  2.1-1             FALSE
car         2.1-4  2.1-6             FALSE
sjPlot      2.3.1  2.4.0             FALSE

  > Binaries will be installed
Packages which are only available in source form, and may need compilation of C/C++/Fortran: ‘rlang’
  ‘tidyselect’
  These will not be installed
> trying URL '...cran.rstudio.com/bin/windows/contrib/3.2/bindrcpp_0.1.zip'
Content type 'application/zip' length 567177 bytes (553 KB)
downloaded 553 KB

> trying URL '...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 '...cran.rstudio.com/bin/windows/contrib/3.2/purrr_0.2.2.zip'
Content type 'application/zip' length 807672 bytes (788 KB)
downloaded 788 KB

> trying URL '...cran.rstudio.com/bin/windows/contrib/3.2/dplyr_0.5.0.zip'
Content type 'application/zip' length 2520396 bytes (2.4 MB)
downloaded 2.4 MB

> trying URL '...cran.rstudio.com/bin/windows/contrib/3.2/tibble_1.3.0.zip'
Content type 'application/zip' length 566754 bytes (553 KB)
downloaded 553 KB

> trying URL '...cran.rstudio.com/bin/windows/contrib/3.2/tidyr_0.6.1.zip'
Content type 'application/zip' length 802821 bytes (784 KB)
downloaded 784 KB

>package ‘bindrcpp’ successfully unpacked and MD5 sums checked
package ‘glue’ successfully unpacked and MD5 sums checked
package ‘purrr’ successfully unpacked and MD5 sums checked
package ‘dplyr’ successfully unpacked and MD5 sums checked
package ‘tibble’ successfully unpacked and MD5 sums checked
package ‘tidyr’ successfully unpacked and MD5 sums checked

> The downloaded binary packages are in
    C:\Users\mmarttin\AppData\Local\Temp\RtmpKQqs8X\downloaded_packages
> installing the source packages ‘bayesplot’, ‘pillar’, ‘ggeffects’, ‘sjlabelled’, ‘sjmisc’, ‘sjstats’, ‘AICcmodavg’, ‘car’, ‘sjPlot’

> trying URL '...cran.rstudio.com/src/contrib/bayesplot_1.4.0.tar.gz'
> Content type 'application/x-gzip' length 4736155 bytes (4.5 MB)
downloaded 4.5 MB

> trying URL '...cran.rstudio.com/src/contrib/pillar_1.1.0.tar.gz'
> Content type 'application/x-gzip' length 71173 bytes (69 KB)
downloaded 69 KB

> trying URL '...cran.rstudio.com/src/contrib/ggeffects_0.3.1.tar.gz'
> Content type 'application/x-gzip' length 215735 bytes (210 KB)
downloaded 210 KB

> trying URL '...cran.rstudio.com/src/contrib/sjlabelled_1.0.6.tar.gz'
> Content type 'application/x-gzip' length 132974 bytes (129 KB)
downloaded 129 KB

> trying URL '...cran.rstudio.com/src/contrib/sjmisc_2.6.3.tar.gz'
> Content type 'application/x-gzip' length 171577 bytes (167 KB)
downloaded 167 KB

> trying URL '...cran.rstudio.com/src/contrib/sjstats_0.14.0.tar.gz'
> Content type 'application/x-gzip' length 258648 bytes (252 KB)
downloaded 252 KB

> trying URL '...cran.rstudio.com/src/contrib/AICcmodavg_2.1-1.tar.gz'
> Content type 'application/x-gzip' length 250768 bytes (244 KB)
downloaded 244 KB

> trying URL '...cran.rstudio.com/src/contrib/car_2.1-6.tar.gz'
> Content type 'application/x-gzip' length 627349 bytes (612 KB)
downloaded 612 KB

> trying URL '...cran.rstudio.com/src/contrib/sjPlot_2.4.0.tar.gz'
> Content type 'application/x-gzip' length 917066 bytes (895 KB)
downloaded 895 KB

> ERROR: dependency 'rlang' is not available for package 'bayesplot'
* removing 'C:/Users/mmarttin/Documents/R/win-library/3.2/bayesplot'
> Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-32~1.1/bin/x64/R" CMD INSTALL -l "C:\Users\mmarttin\Documents\R\win-library\3.2" C:\Users\mmarttin\AppData\Local\Temp\RtmpKQqs8X/downloaded_packages/bayesplot_1.4.0.tar.gz' had status 1
> Warning in install.packages :
  installation of package ‘bayesplot’ had non-zero exit status
> ERROR: dependency 'rlang' is not available for package 'pillar'
* removing 'C:/Users/mmarttin/Documents/R/win-library/3.2/pillar'
> Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-32~1.1/bin/x64/R" CMD INSTALL -l "C:\Users\mmarttin\Documents\R\win-library\3.2" C:\Users\mmarttin\AppData\Local\Temp\RtmpKQqs8X/downloaded_packages/pillar_1.1.0.tar.gz' had status 1
> Warning in install.packages :
  installation of package ‘pillar’ had non-zero exit status
> ERROR: dependency 'rlang' is not available for package 'sjlabelled'
* removing 'C:/Users/mmarttin/Documents/R/win-library/3.2/sjlabelled'
> Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-32~1.1/bin/x64/R" CMD INSTALL -l "C:\Users\mmarttin\Documents\R\win-library\3.2" C:\Users\mmarttin\AppData\Local\Temp\RtmpKQqs8X/downloaded_packages/sjlabelled_1.0.6.tar.gz' had status 1
> Warning in install.packages :
  installation of package ‘sjlabelled’ had non-zero exit status
> ERROR: dependency 'VGAM' is not available for package 'AICcmodavg'
* removing 'C:/Users/mmarttin/Documents/R/win-library/3.2/AICcmodavg'
> Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-32~1.1/bin/x64/R" CMD INSTALL -l "C:\Users\mmarttin\Documents\R\win-library\3.2" C:\Users\mmarttin\AppData\Local\Temp\RtmpKQqs8X/downloaded_packages/AICcmodavg_2.1-1.tar.gz' had status 1
> Warning in install.packages :
  installation of package ‘AICcmodavg’ had non-zero exit status
> ERROR: dependency 'pbkrtest' is not available for package 'car'
* removing 'C:/Users/mmarttin/Documents/R/win-library/3.2/car'
> Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-32~1.1/bin/x64/R" CMD INSTALL -l "C:\Users\mmarttin\Documents\R\win-library\3.2" C:\Users\mmarttin\AppData\Local\Temp\RtmpKQqs8X/downloaded_packages/car_2.1-6.tar.gz' had status 1
> Warning in install.packages :
  installation of package ‘car’ had non-zero exit status
> ERROR: dependencies 'rlang', 'sjlabelled', 'tidyselect' are not available for package 'sjmisc'
* removing 'C:/Users/mmarttin/Documents/R/win-library/3.2/sjmisc'
> Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-32~1.1/bin/x64/R" CMD INSTALL -l "C:\Users\mmarttin\Documents\R\win-library\3.2" C:\Users\mmarttin\AppData\Local\Temp\RtmpKQqs8X/downloaded_packages/sjmisc_2.6.3.tar.gz' had status 1
> Warning in install.packages :
  installation of package ‘sjmisc’ had non-zero exit status
> ERROR: dependencies 'bayesplot', 'rlang', 'sjlabelled', 'sjmisc', 'tidyselect' are not available for package 'sjstats'
* removing 'C:/Users/mmarttin/Documents/R/win-library/3.2/sjstats'
> Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-32~1.1/bin/x64/R" CMD INSTALL -l "C:\Users\mmarttin\Documents\R\win-library\3.2" C:\Users\mmarttin\AppData\Local\Temp\RtmpKQqs8X/downloaded_packages/sjstats_0.14.0.tar.gz' had status 1
> Warning in install.packages :
  installation of package ‘sjstats’ had non-zero exit status
ERROR: dependencies 'rlang', 'sjlabelled', 'sjmisc', 'sjstats', 'tidyselect' are not available for package 'ggeffects'
* removing 'C:/Users/mmarttin/Documents/R/win-library/3.2/ggeffects'
> Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-32~1.1/bin/x64/R" CMD INSTALL -l "C:\Users\mmarttin\Documents\R\win-library\3.2" C:\Users\mmarttin\AppData\Local\Temp\RtmpKQqs8X/downloaded_packages/ggeffects_0.3.1.tar.gz' had status 1
> Warning in install.packages :
  installation of package ‘ggeffects’ had non-zero exit status
ERROR: dependencies 'ggeffects', 'rlang', 'sjlabelled', 'sjmisc', 'sjstats', 'tidyselect' are not available for package 'sjPlot'
* removing 'C:/Users/mmarttin/Documents/R/win-library/3.2/sjPlot'
> Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-32~1.1/bin/x64/R" CMD INSTALL -l "C:\Users\mmarttin\Documents\R\win-library\3.2" C:\Users\mmarttin\AppData\Local\Temp\RtmpKQqs8X/downloaded_packages/sjPlot_2.4.0.tar.gz' had status 1
> Warning in install.packages :
  installation of package ‘sjPlot’ had non-zero exit status

> The downloaded source packages are in
    ‘C:\Users\mmarttin\AppData\Local\Temp\RtmpKQqs8X\downloaded_packages’

I've tried installing VGAM and pbkrtest, along with rlang and tidyselect, but it just says the following:

> Warning in install.packages :
  packages ‘VGAM’, ‘pbkrtest’ are not available (for R version 3.2.1)

> Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘rlang’
  These will not be installed

> Packages which are only available in source form, and may need compilation of C/C++/Fortran: ‘rlang’
  ‘tidyselect’
  These will not be installed

From what I can understand, the most central package seems to be rlang. So I read in some thread that perhaps I could download RTools to my computer and try to download rlang again, but I can't seem to open Rtools in R (or however it works; I tried to follow a guide on https://github.com/stan-dev/rstan/wiki/Install-Rtools-for-Windows but I couldn't make it work).

I also tried to download the .zip file and open the package in R; however, that only lead to error when I tried again to install sjPlot (something along the lines of "the procedure entry point could not be located in the dynamic link library...", referent to the rlang package).

As I'm sure you can tell, I'm quite lost and would really appreciate any kind of help in resolving this issue! Not sure what kind of info you need from me, but I'm running on a Windows 8.1, RStudio latest version available on their website (RStudio Desktop 1.1.419).

I've also tried re-installing RStudio, looked for updates, etc.

You are using an older release of R (version 3.2), and for some packages, binaries may not be built for that R version yet. However, rlang and tidyselect seem to be available as windows binaries for R 3.2.

If possible, I would recommend to update R to the latest release (3.4.x) and then install RTools ( https://cran.r-project.org/bin/windows/Rtools/ ), which simply needs to be executed (it installs a C++-compiler and modifies your PATH variable, so R will find the C++-compiler if needed).

Maybe this already solves your problem?

Another option might be to install other packages with dependencies first, eg tidyr , dplyr , rlang , tibble , purrr , ... (the tidyverse packages), and then install the next packages. So, don't install all packages in one call to install.packages() , but in multiple steps.

if you are using conda env than you should try this command after active your conda enviroment conda install -c conda-forge r-sjplot

for more info

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM