Swirl: Error in install.packages in R Studio

Created on 24 Jan 2018  Â·  4Comments  Â·  Source: swirldev/swirl

Hello, I'm receiving the following message in my console when installing swirl in R Studio. I'm on a Windows 10, 64-bit computer at work.

`> install.packages("swirl")
Installing package into ‘C:/Users/adamq/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependencies ‘assertthat’, ‘stringi’, ‘magrittr’, ‘cli’, ‘crayon’, ‘praise’, ‘R6’, ‘rlang’, ‘withr’, ‘jsonlite’, ‘mime’, ‘curl’, ‘openssl’, ‘bitops’, ‘stringr’, ‘testthat’, ‘httr’, ‘yaml’, ‘RCurl’, ‘digest’

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/assertthat_0.2.0.zip'
Content type 'application/zip' length 43954 bytes (42 KB)
downloaded 42 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/stringi_1.1.6.zip'
Content type 'application/zip' length 14295451 bytes (13.6 MB)
downloaded 13.6 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/magrittr_1.5.zip'
Content type 'application/zip' length 155726 bytes (152 KB)
downloaded 152 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/cli_1.0.0.zip'
Content type 'application/zip' length 304704 bytes (297 KB)
downloaded 297 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/crayon_1.3.4.zip'
Content type 'application/zip' length 711051 bytes (694 KB)
downloaded 694 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/praise_1.0.0.zip'
Content type 'application/zip' length 17933 bytes (17 KB)
downloaded 17 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/R6_2.2.2.zip'
Content type 'application/zip' length 316800 bytes (309 KB)
downloaded 309 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/rlang_0.1.6.zip'
Content type 'application/zip' length 467596 bytes (456 KB)
downloaded 456 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/withr_2.1.1.zip'
Content type 'application/zip' length 120357 bytes (117 KB)
downloaded 117 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/jsonlite_1.5.zip'
Content type 'application/zip' length 1159857 bytes (1.1 MB)
downloaded 1.1 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/mime_0.5.zip'
Content type 'application/zip' length 38061 bytes (37 KB)
downloaded 37 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/curl_3.1.zip'
Content type 'application/zip' length 3470640 bytes (3.3 MB)
downloaded 3.3 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/openssl_0.9.9.zip'
Content type 'application/zip' length 3491569 bytes (3.3 MB)
downloaded 3.3 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/bitops_1.0-6.zip'
Content type 'application/zip' length 37229 bytes (36 KB)
downloaded 36 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/stringr_1.2.0.zip'
Content type 'application/zip' length 148898 bytes (145 KB)
downloaded 145 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/testthat_2.0.0.zip'
Content type 'application/zip' length 1196854 bytes (1.1 MB)
downloaded 1.1 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/httr_1.3.1.zip'
Content type 'application/zip' length 300970 bytes (293 KB)
downloaded 293 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/yaml_2.1.16.zip'
Content type 'application/zip' length 184312 bytes (179 KB)
downloaded 179 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/RCurl_1.95-4.10.zip'
Content type 'application/zip' length 2869612 bytes (2.7 MB)
downloaded 2.7 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/digest_0.6.14.zip'
Content type 'application/zip' length 174091 bytes (170 KB)
downloaded 170 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/swirl_2.4.3.zip'
Content type 'application/zip' length 236674 bytes (231 KB)
downloaded 231 KB

Error in install.packages : cannot open file 'C:/Users/adamq/Documents/R/win-library/3.4/file3d94187b17d7/assertthat/DESCRIPTION': Permission denied`

Any help would be greatly appreciated. Thanks!

Most helpful comment

It worked! I was installing them by default in a folder in my Documents, so I switch to installing them in Program Files. Thanks!

All 4 comments

Thanks for the quick reply, Sean. I tried the solution at that link, and I still receive the same error.

I even tried it again on my home (personal) computer on my own home network, and received the exact same error. Is there something else that might be wrong? This is my first time using R, so could it possibly be an install error?

I'm really surprised it doesn't work on your home computer! Can you try running RStudio as an administrator? You might also want to see:

It worked! I was installing them by default in a folder in my Documents, so I switch to installing them in Program Files. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bwkeim picture bwkeim  Â·  46Comments

nmcgarry picture nmcgarry  Â·  4Comments

akshaynaik29 picture akshaynaik29  Â·  6Comments

HengshuoLiu picture HengshuoLiu  Â·  12Comments

mralexpopa picture mralexpopa  Â·  20Comments