Fail to install R packages - r

> install.packages("rmarkdown")
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/Admin/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
also installing the dependencies ‘rlang’, ‘fastmap’, ‘glue’, ‘magrittr’, ‘stringi’, ‘knitr’, ‘yaml’, ‘htmltools’, ‘jsonlite’, ‘tinytex’, ‘xfun’, ‘jquerylib’, ‘stringr’
trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.1/rlang_0.4.12.zip'
Content type 'application/zip' length 1200955 bytes (1.1 MB)
downloaded 1.1 MB
trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.1/fastmap_1.1.0.zip'
Content type 'application/zip' length 215493 bytes (210 KB)
downloaded 210 KB
trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.1/glue_1.4.2.zip'
Content type 'application/zip' length 155685 bytes (152 KB)
downloaded 152 KB
trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.1/magrittr_2.0.1.zip'
Content type 'application/zip' length 235887 bytes (230 KB)
downloaded 230 KB
trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.1/stringi_1.7.5.zip'
Content type 'application/zip' length 16449351 bytes (15.7 MB)
downloaded 15.7 MB
trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.1/knitr_1.36.zip'
Content type 'application/zip' length 1469810 bytes (1.4 MB)
downloaded 1.4 MB
trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.1/yaml_2.2.1.zip'
Content type 'application/zip' length 207878 bytes (203 KB)
downloaded 203 KB
trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.1/htmltools_0.5.2.zip'
Content type 'application/zip' length 347479 bytes (339 KB)
downloaded 339 KB
trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.1/jsonlite_1.7.2.zip'
Content type 'application/zip' length 544517 bytes (531 KB)
downloaded 531 KB
trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.1/tinytex_0.34.zip'
Content type 'application/zip' length 123943 bytes (121 KB)
downloaded 121 KB
trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.1/xfun_0.27.zip'
Content type 'application/zip' length 381203 bytes (372 KB)
downloaded 372 KB
trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.1/jquerylib_0.1.4.zip'
Content type 'application/zip' length 525858 bytes (513 KB)
downloaded 513 KB
trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.1/stringr_1.4.0.zip'
Content type 'application/zip' length 216647 bytes (211 KB)
downloaded 211 KB
trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.1/rmarkdown_2.11.zip'
Content type 'application/zip' length 3660952 bytes (3.5 MB)
downloaded 3.5 MB
Error in install.packages : cannot open file 'C:/Users/Admin/Documents/R/win-library/4.1/file23707312823/rlang/help/figures/rlang.png': Permission denied

I guess you just need to install Rtools before installing the rmarkdown package. You can do that from the following link: https://cran.r-project.org/bin/windows/Rtools/

Related

quesion of loading the packages of Rstudio

Everytime I load the packages of Rstudio and always get the following messages.something wrong ?
將程式套件安載入 ‘C:/Users/User/AppData/Local/R/win-library/4.2’
(因為 ‘lib’ 沒有被指定)
還安裝相依關係 ‘lpSolve’
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.2/lpSolve_5.6.15.zip'
Content type 'application/zip' length 360412 bytes (351 KB)
downloaded 351 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.2/sampling_2.9.zip'
Content type 'application/zip' length 917991 bytes (896 KB)
downloaded 896 KB

Can't install packages in RStudio - blocked after download

I'm trying to install the package "sqldf" in RStudio but it blocks after downloading few packages
R version 3.5.0 (2018-04-23)
> install.packages("sqldf")
Installing package into ‘C:/Users/sperga/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
also installing the dependencies ‘BH’, ‘plogr’, ‘gsubfn’, ‘proto’, ‘RSQLite’, ‘DBI’, ‘chron’
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/BH_1.66.0-1.zip'
Content type 'application/zip' length 17880019 bytes (17.1 MB)
downloaded 17.1 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/plogr_0.2.0.zip'
Content type 'application/zip' length 18718 bytes (18 KB)
downloaded 18 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/gsubfn_0.7.zip'
Content type 'application/zip' length 357663 bytes (349 KB)
downloaded 349 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/proto_1.0.0.zip'
Content type 'application/zip' length 471954 bytes (460 KB)
downloaded 460 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/RSQLite_2.1.1.zip'
Content type 'application/zip' length 2154846 bytes (2.1 MB)
downloaded 2.1 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/DBI_1.0.0.zip'
Content type 'application/zip' length 887210 bytes (866 KB)
downloaded 866 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/chron_2.3-52.zip'
Content type 'application/zip' length 198130 bytes (193 KB)
downloaded 193 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/sqldf_0.4-11.zip'
Content type 'application/zip' length 78155 bytes (76 KB)
downloaded 76 KB
I also tried to shitch the CRAN but it didn't work.
Many thanks!
I had the exact problem, but I loaded the RGui, ran it as administrator, typed the install command (install.packages("ez") for me), and just let it run. After about 10 solid minutes it finished. Could be you're just not waiting long enough.

Unable to install dplyr package on windows vista

I'm trying to install the dplyr package on my Windows vista machine (through R Studio). I have the latest version of R installed (3.22) and the preview version of R Studio installed. I've had no issues in the past installing packages, however when I try to install this one, I got error:
> install.packages("dplyr")
Installing package into ‘C:/Users/user/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
also installing the dependency ‘BH’
trying URL 'http://cran.stat.sfu.ca/bin/windows/contrib/3.2/BH_1.58.0-1.zip'
Content type 'application/zip' length 13846694 bytes (13.2 MB)
downloaded 13.2 MB
trying URL 'http://cran.stat.sfu.ca/bin/windows/contrib/3.2/dplyr_0.4.3.zip'
Content type 'application/zip' length 2552598 bytes (2.4 MB)
downloaded 2.4 MB
I also tried installing the devtools package so that I could install the dplyr package straight from github. However, the devtools package also gave me trouble on installation:
> install.packages("devtools")
Installing package into ‘C:/Users/user/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
also installing the dependencies ‘BH’, ‘brew’, ‘xml2’, ‘httr’, ‘curl’, ‘memoise’, ‘whisker’, ‘jsonlite’, ‘roxygen2’, ‘rversions’, ‘git2r’
trying URL 'http://cran.stat.sfu.ca/bin/windows/contrib/3.2/BH_1.58.0-1.zip'
Content type 'application/zip' length 13846694 bytes (13.2 MB)
downloaded 13.2 MB
trying URL 'http://cran.stat.sfu.ca/bin/windows/contrib/3.2/brew_1.0-6.zip'
Content type 'application/zip' length 104730 bytes (102 KB)
downloaded 102 KB
trying URL 'http://cran.stat.sfu.ca/bin/windows/contrib/3.2/xml2_0.1.2.zip'
Content type 'application/zip' length 3174710 bytes (3.0 MB)
downloaded 3.0 MB
trying URL 'http://cran.stat.sfu.ca/bin/windows/contrib/3.2/httr_1.0.0.zip'
Content type 'application/zip' length 382429 bytes (373 KB)
downloaded 373 KB
trying URL 'http://cran.stat.sfu.ca/bin/windows/contrib/3.2/curl_0.9.3.zip'
Content type 'application/zip' length 4384906 bytes (4.2 MB)
downloaded 4.2 MB
trying URL 'http://cran.stat.sfu.ca/bin/windows/contrib/3.2/memoise_0.2.1.zip'
Content type 'application/zip' length 16878 bytes (16 KB)
downloaded 16 KB
trying URL 'http://cran.stat.sfu.ca/bin/windows/contrib/3.2/whisker_0.3-2.zip'
Content type 'application/zip' length 64756 bytes (63 KB)
downloaded 63 KB
trying URL 'http://cran.stat.sfu.ca/bin/windows/contrib/3.2/jsonlite_0.9.17.zip'
Content type 'application/zip' length 1009755 bytes (986 KB)
downloaded 986 KB
trying URL 'http://cran.stat.sfu.ca/bin/windows/contrib/3.2/roxygen2_4.1.1.zip'
Content type 'application/zip' length 594453 bytes (580 KB)
downloaded 580 KB
trying URL 'http://cran.stat.sfu.ca/bin/windows/contrib/3.2/rversions_1.0.2.zip'
Content type 'application/zip' length 16455 bytes (16 KB)
downloaded 16 KB
trying URL 'http://cran.stat.sfu.ca/bin/windows/contrib/3.2/git2r_0.11.0.zip'
Content type 'application/zip' length 2690457 bytes (2.6 MB)
downloaded 2.6 MB
trying URL 'http://cran.stat.sfu.ca/bin/windows/contrib/3.2/devtools_1.9.1.zip'
Content type 'application/zip' length 357684 bytes (349 KB)
downloaded 349 KB
None of these files ever get written into ‘C:/Users/user/Documents/R/win-library/3.2’.
Other things tried:
making sure that I have the latest version of R installed
opening R Studio in Administrator mode and installing the packages then
installing in R commander instead
trying a different CRAN mirror
None of these helped.
Any ideas how to install dplyr?
As #erasmortg suggested in the comments, I first downloaded the dplyr zip file from the cran-r page. Then ran:
utils::install.packages("c:/R/dplyrversion.zip", repos=NULL)

can't install "CHAID" on Mac OS X 10.9.5

I have encountered a problem of installing CHAID package on my Mac. I am not sure if it is a problem of my Mac OS version or some other problems. Could anyone help?
Thank you so much!!
install.packages("CHAID", repos="http://R-Forge.R-project.org")
Warning in install.packages :
cannot open: HTTP status was '404 Not Found'
Warning in install.packages :
cannot open: HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository http://R-Forge.R-project.org/bin/macosx/mavericks/contrib/3.1
package ‘CHAID’ is available as a source package but not as a binary
Warning in install.packages :
package ‘CHAID’ is not available (for R version 3.1.2)
You first need to install the 'partykit' package (and all of its dependincies) and then issue this command:
install.packages("CHAID", repos="http://R-Forge.R-project.org", type="source")
This is the transcript on a Yosemite machine but I think this should also succeed on Mavericks. (You can notice that there is no invocation of compiled code, so I do not need to warn you that XCode might be needed.)
> install.packages("CHAID", repos="http://R-Forge.R-project.org", type="source")
Warning: dependency ‘partykit’ is not available
trying URL 'http://R-Forge.R-project.org/src/contrib/CHAID_0.1-1.tar.gz'
Content type 'application/x-gzip' length 356348 bytes (347 KB)
opened URL
==================================================
downloaded 347 KB
ERROR: dependency ‘partykit’ is not available for package ‘CHAID’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/CHAID’
The downloaded source packages are in
‘/private/var/folders/yq/m3j1jqtj6hq6s5mq_v0jn3s80000gp/T/RtmpMD0mfx/downloaded_packages’
Warning message:
In install.packages("CHAID", repos = "http://R-Forge.R-project.org", :
installation of package ‘CHAID’ had non-zero exit status
also installing the dependencies ‘RWekajars’, ‘pmml’, ‘strucchange’, ‘mlbench’, ‘RWeka’, ‘psychotools’, ‘psychotree’
trying URL 'http://cran.cnr.Berkeley.edu/bin/macosx/mavericks/contrib/3.1/RWekajars_3.7.12-1.tgz'
Content type 'application/x-gzip' length 6562134 bytes (6.3 MB)
opened URL
==================================================
downloaded 6.3 MB
trying URL 'http://cran.cnr.Berkeley.edu/bin/macosx/mavericks/contrib/3.1/pmml_1.4.2.tgz'
Content type 'application/x-gzip' length 184357 bytes (180 KB)
opened URL
==================================================
downloaded 180 KB
trying URL 'http://cran.cnr.Berkeley.edu/bin/macosx/mavericks/contrib/3.1/strucchange_1.5-0.tgz'
Content type 'application/x-gzip' length 784786 bytes (766 KB)
opened URL
==================================================
downloaded 766 KB
trying URL 'http://cran.cnr.Berkeley.edu/bin/macosx/mavericks/contrib/3.1/mlbench_2.1-1.tgz'
Content type 'application/x-gzip' length 1021909 bytes (997 KB)
opened URL
==================================================
downloaded 997 KB
trying URL 'http://cran.cnr.Berkeley.edu/bin/macosx/mavericks/contrib/3.1/RWeka_0.4-24.tgz'
Content type 'application/x-gzip' length 533932 bytes (521 KB)
opened URL
==================================================
downloaded 521 KB
trying URL 'http://cran.cnr.Berkeley.edu/bin/macosx/mavericks/contrib/3.1/psychotools_0.4-0.tgz'
Content type 'application/x-gzip' length 353913 bytes (345 KB)
opened URL
==================================================
downloaded 345 KB
trying URL 'http://cran.cnr.Berkeley.edu/bin/macosx/mavericks/contrib/3.1/psychotree_0.15-0.tgz'
Content type 'application/x-gzip' length 257879 bytes (251 KB)
opened URL
==================================================
downloaded 251 KB
trying URL 'http://cran.cnr.Berkeley.edu/bin/macosx/mavericks/contrib/3.1/partykit_0.8-4.tgz'
Content type 'application/x-gzip' length 1194059 bytes (1.1 MB)
opened URL
==================================================
downloaded 1.1 MB
The downloaded binary packages are in
/var/folders/yq/m3j1jqtj6hq6s5mq_v0jn3s80000gp/T//RtmpMD0mfx/downloaded_packages
> install.packages("CHAID", repos="http://R-Forge.R-project.org", type="source")
trying URL 'http://R-Forge.R-project.org/src/contrib/CHAID_0.1-1.tar.gz'
Content type 'application/x-gzip' length 356348 bytes (347 KB)
opened URL
==================================================
downloaded 347 KB
* installing *source* package ‘CHAID’ ...
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (CHAID)
The downloaded source packages are in
‘/private/var/folders/yq/m3j1jqtj6hq6s5mq_v0jn3s80000gp/T/RtmpMD0mfx/downloaded_packages’
>

Couldn't install R packages on Ubuntu 14.04 [duplicate]

I'm on ubuntu precise pangolin running inside a VM, using R 3.1 and Rstudio 0.98.507 and I'm unable to install ggplot2
Here is the output :
install.packages('ggplot2')
Installing package into ‘/home/uwhpsc/R/i686-pc-linux-gnu-library/3.1’
(as ‘lib’ is unspecified)
also installing the dependencies ‘colorspace’, ‘Rcpp’, ‘stringr’, ‘RColorBrewer’, ‘dichromat’, ‘munsell’, ‘labeling’, ‘plyr’, ‘digest’, ‘gtable’, ‘reshape2’, ‘scales’, ‘proto’
trying URL 'http://cran.rstudio.com/src/contrib/colorspace_1.2-4.tar.gz'
Content type 'application/x-gzip' length 242791 bytes (237 Kb)
opened URL
==================================================
downloaded 237 Kb
trying URL 'http://cran.rstudio.com/src/contrib/Rcpp_0.11.1.tar.gz'
Content type 'application/x-gzip' length 2003515 bytes (1.9 Mb)
opened URL
==================================================
downloaded 1.9 Mb
trying URL 'http://cran.rstudio.com/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.rstudio.com/src/contrib/RColorBrewer_1.0-5.tar.gz'
Content type 'application/x-gzip' length 10656 bytes (10 Kb)
opened URL
==================================================
downloaded 10 Kb
trying URL 'http://cran.rstudio.com/src/contrib/dichromat_2.0-0.tar.gz'
Content type 'application/x-gzip' length 84320 bytes (82 Kb)
opened URL
==================================================
downloaded 82 Kb
trying URL 'http://cran.rstudio.com/src/contrib/munsell_0.4.2.tar.gz'
Content type 'application/x-gzip' length 91026 bytes (88 Kb)
opened URL
==================================================
downloaded 88 Kb
trying URL 'http://cran.rstudio.com/src/contrib/labeling_0.2.tar.gz'
Content type 'application/x-gzip' length 9998 bytes
opened URL
==================================================
downloaded 9998 bytes
trying URL 'http://cran.rstudio.com/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.rstudio.com/src/contrib/digest_0.6.4.tar.gz'
Content type 'application/x-gzip' length 79309 bytes (77 Kb)
opened URL
==================================================
downloaded 77 Kb
trying URL 'http://cran.rstudio.com/src/contrib/gtable_0.1.2.tar.gz'
Content type 'application/x-gzip' length 19667 bytes (19 Kb)
opened URL
==================================================
downloaded 19 Kb
trying URL 'http://cran.rstudio.com/src/contrib/reshape2_1.4.tar.gz'
Content type 'application/x-gzip' length 34121 bytes (33 Kb)
opened URL
==================================================
downloaded 33 Kb
trying URL 'http://cran.rstudio.com/src/contrib/scales_0.2.4.tar.gz'
Content type 'application/x-gzip' length 40093 bytes (39 Kb)
opened URL
==================================================
downloaded 39 Kb
trying URL 'http://cran.rstudio.com/src/contrib/proto_0.3-10.tar.gz'
Content type 'application/x-gzip' length 530758 bytes (518 Kb)
opened URL
==================================================
downloaded 518 Kb
trying URL 'http://cran.rstudio.com/src/contrib/ggplot2_0.9.3.1.tar.gz'
Content type 'application/x-gzip' length 2330942 bytes (2.2 Mb)
opened URL
==================================================
downloaded 2.2 Mb
The downloaded source packages are in
‘/tmp/Rtmpi3YRSS/downloaded_packages’
> library(ggplot2)
Error in library(ggplot2) : there is no package called ‘ggplot2’
If you dont have a swap file enabled and run out of ram the OOM (out of memory) killer will normally terminate the offending process. This exhibits itself in the manner described in the OP's question when attempting to install packages. To fix this a swap file should be enabled.
$ dd if=/dev/zero of=/swapfile bs=1024 count=512k
$ mkswap /swapfile
$ swapon /swapfile
You can change attributes for the swap file like swappiness see an example here.

Resources