Ubuntu – Problem in installing packages in R

14.04r

In R, I am trying to run –

install.package('rattle')

but terminal gives me following error –

Error in .chooseMirror(m, "CRAN", graphics, ind, useHTTPS) : 
could not find function "setNames"

R version – 3.2.2
Ubuntu – 14.04 LTS

How to solve this error?

Maybe because I had few problems during installation of R-base –

From Command Line, It would only install 3.0.2, but not 3.2.2.
Hence, I installed R-3.2.2 from Ubuntu software centre.

From Software centre, it would not install r-base, and give following ERROR :

Package dependencies cannot be resolved
he following packages have unmet dependencies:

r-base: Depends: r-base-core (>= 3.2.2-1trusty0) but 3.2.2-1trusty0 is to be installed
Depends: r-recommended (= 3.2.2-1trusty0) but 3.0.2-1ubuntu1 is to be installed

So after that, from software center I tried first installing r-base-core-1trusty0, and then r-base-1trusty0.
It worked and I had R-3.2.2 installed in system.

While installing a package from R, by install.packages(), It ask me to choose a mirror. After choosing mirror, I get the above error. stating problem in .chooseMirror(…)

I get the same error of .chooseMirror, When I try –

update.packages(checkBuilt=TRUE)

Maybe the error could be due to installation problems

P.S: I am reposting this question after making edit on this question because don't have enough reputation points to comment on others post.

Best Answer

Try using R --vanilla - an .Rprofile can break it - mine does...