Reputation: 6447
I don't remember having any problems with this, but seemingly suddenly, I can't install any packages because testthat
is not there to pass tests. As a catch-22, I can't install testthat
either, because it's not there to pass its tests.
R version 3.0.1 (2013-05-16) -- "Good Sport"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
Error in library(testthat) : there is no package called 'testthat'
[Previously saved workspace restored]
>
> install.packages("testthat")
Installing package into '/home/user/R/x86_64-pc-linux-gnu-library/3.0'
(as 'lib' is unspecified)
--- Please select a CRAN mirror for use in this session ---
Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 14: reading configurations from ~/.fonts.conf is deprecated.
trying URL 'http://cran.cs.wwu.edu/src/contrib/testthat_0.8.1.tar.gz'
Content type 'application/x-gzip' length 40777 bytes (39 Kb)
opened URL
==================================================
downloaded 39 Kb
Error in library(testthat) : there is no package called 'testthat'
Calls: source -> withVisible -> eval -> eval -> library
Execution halted
The downloaded source packages are in
'/tmp/RtmpMoaIPO/downloaded_packages'
Warning message:
In install.packages("testthat") :
installation of package 'testthat' had non-zero exit status
Is there a way to bypass testing for one install run or otherwise work around this so I can fix my R install?
Upvotes: 2
Views: 2491
Reputation: 731
If you are using linux, you don't have to manually download the package, installing the dependency( in this case 'testthat') via your default manager will also work. I have ubuntu 14.04 and R 3.0.2
sudo apt-get install r-cran-testthat
After running the above command I was able to finally install swirl.
Upvotes: 5
Reputation: 205
I live somewhere with poor internet, and I didn't want to download a new version of R and all its dependencies to fix this problem. So you can install an old version of testthat manually: http://cran.r-project.org/src/contrib/Archive/testthat/
On version 3.0.2, testthat version 0.8.1 seems to work. Once you have downloaded the gzip file, do:
R CMD INSTALL testthat_0.8.1.tar.gz
Upvotes: 5
Reputation: 6447
For the record, a full update fixed this, but I don't know why.
Upvotes: 0