Locating Downloaded Packages in R and Rstudio

Hi,
Recently I had difficulty in downloading packages in RStudio, so I followed advice on this forum to do it through R itself and that worked. But when I downloaded devtools this is what I got, and I'm unable to determine exactly how to access it. I tried using setwd() to the path specified immediately below, but that didn't work. I am working through Windows 10, and I just installed the latest version of R 3.4.3. Thanks for your help.

Nancy

The downloaded source packages are in
        ‘C:\Users\Wahl\AppData\Local\Temp\RtmpQXobzt\downloaded_packages’
Warning messages:
1: running command '"C:/PROGRA~1/R/R-34~1.3/bin/x64/R" CMD INSTALL -l "C:\Users\Wahl\Documents\R\win-library\3.4" C:\Users\Wahl\AppData\Local\Temp\RtmpQXobzt/downloaded_packages/httr_1.3.1.tar.gz' had status 1 
2: In install.packages("devtools") :
  installation of package ‘httr’ had non-zero exit status
3: running command '"C:/PROGRA~1/R/R-34~1.3/bin/x64/R" CMD INSTALL -l "C:\Users\Wahl\Documents\R\win-library\3.4" C:\Users\Wahl\AppData\Local\Temp\RtmpQXobzt/downloaded_packages/memoise_1.1.0.tar.gz' had status 1 
4: In install.packages("devtools") :
  installation of package ‘memoise’ had non-zero exit status

Did you try installing httr and memoise separately before installing devtools?

install.packages(c("httr", "memoise", "devtools"))

Hi Tyler,

No I am not at all familiar with httr or memoise, but I will try them. I remember I never had any trouble installing packages at work or school with just simply running the install.packages command. Now it's a very complicated deal. I'm not sure if it's the new version of R or my laptop or both, but I will see if your suggestion works. Are httr and memoise applicable to other packages by the way?

Thanks very much.

Nancy

Hi,

It didn't work out. This is what I got:

install.packages(c("httr","memoise","devtools"))

Installing packages into
‘C:/Users/Wahl/Documents/R/win-library/3.4’

(as ‘lib’ is unspecified)

---Please select a CRAN mirror for
use in this session ---

also installing the dependencies
‘jsonlite’, ‘mime’, ‘curl’, ‘openssl’, ‘digest’, ‘git2r’

trying URL
'https://rweb.crmda.ku.edu/cran/bin/windows/contrib/3.4/devtools_1.13.5.zip'

Content type 'application/zip'
length 443954 bytes (433 KB)

downloaded 248 KB

Error in read.dcf(file.path(pkgname,
"DESCRIPTION"), c("Package", "Type")) :

cannot open the connection

In addition: Warning messages:

1: In readRDS(dest) : lzma decoding
result 10

2: In download.file(url, destfile,
method, mode = "wb", ...) :

downloaded length 2703360 != reported length 3470563

3: In download.file(url, destfile,
method, mode = "wb", ...) :

downloaded length 135168 != reported length 3028299

4: In download.file(url, destfile,
method, mode = "wb", ...) :

downloaded length 253952 != reported length 443954

5: In unzip(zipname, exdir = dest) :
error 1 in extracting from zip file

6: In read.dcf(file.path(pkgname,
"DESCRIPTION"), c("Package", "Type")) :

cannot open compressed file
'curl/DESCRIPTION', probable reason 'No such file or directory'

I selected a CRAN mirror in KS, and then it tried to do something but failed. The one thing I have noticed today though is that my internet connection is very very slow,

so I guess that could be a factor. This is the only laptop in the apartment and I'm on broadband, and usually don't have this connection problem. Any other ideas, or should

I just try this again tomorrow?

Nancy

You could try using https://cran.rstudio.com as a CRAN mirror.

install.packages("devtools", repos = "https://cran.rstudio.com")

Hi,

That statement was partially successful in that it installed all these other packages that I can open in Rstudio like memoise and httr, so thanks for some good advice. This is part of what was on my screen:

install.packages("devtools", repos= "https://cran.rstudio.com")
Warning in install.packages :
unable to access index for repository https://mirrors.nics.utk.edu/cran/src/contrib:
cannot open URL 'https://mirrors.nics.utk.edu/cran/src/contrib/PACKAGES'
Installing package into ‘C:/Users/Wahl/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependencies ‘mime’, ‘curl’, ‘openssl’, ‘httr’, ‘memoise’, ‘digest’, ‘jsonlite’, ‘git2r’

(Finally it printed out after about 15 minutes of a slow process)
cannot open compressed file 'git2r/DESCRIPTION', probable reason 'No such file or directory'
Error in install.packages : cannot open the connection
Now, I feel I'm making progress by getting all these other packages installed in my current workspace. But I noticed when I specified the general name for a cran repos it went to the one in Tenn - Oakridge Laboratory I think, and I'm wondering if that one is having issues. Is there a way to specify a different mirror that I can find on the cran website?

I finally resolved my issue.

I just want to thank all who have been helpful to me with my recent troubles in downloading R, and want to share one more thing I've learned from another source online. When I used the statement install.packages("devtools", repos = https://cran.rstudio.com") it worked to get some of the packages I needed with it, but not devtools. I discovered that my default repos at Oakridge on the cran mirror site is not functioning well at the moment according to the status page. So I found a nice little script to change the default one to one that is functioning well at Berkley:

local({
r = getOption("repos")
r["CRAN"] = "http://cran.cnr.berkeley.edu/"
options(repos=r)
})

Once I did that correctly (I had a typo on my first run) it installed the package in less than a minute!