3

I'm trying to install sqldf package in an Ubuntu 14.04 machine, but I'm getting the following error:

Warning in install.packages :
  package ‘sqldf’ is not available (for R version 3.0.2)

I tried to install the library libpq-dev as suggested from other post, but I still receive the message.

UPDATE

I'm trying to update R, but I'm getting the following message:

The following packages have unmet dependencies:
 r-base : Depends: r-base-core (>= 3.1.2-1precise0) but it is not going to be installed
          Depends: r-recommended (= 3.1.2-1precise0) but it is not going to be installed
          Recommends: r-base-html but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I tried the solutions in this topic, but none worked

Community
  • 1
  • 1
Filipe Ferminiano
  • 8,373
  • 25
  • 104
  • 174

3 Answers3

10

Look at the package page:

Depends:    R (≥ 3.1.0), gsubfn (≥ 0.6), proto, RSQLite (≥ 1.0.0)

As the error message clearly states, you are using an older R 3.0.2 which is less than the required 3.1.0.

The fix is easy: read the Ubuntu-specific README, make the adjustment to install (current !!) R binaries as .deb package via apt-get from CRAN -- and you will have R 3.1.2 in no time.

Which will permit you to install the current sqldf as well.

Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
  • 1
    It is all in the README I pointed you to. Update the info for apt, run `apt-get update`, and the next `apt-get dist-upgrade` will get you new R. You can also use the GUIs and what not -- thousands of us use these packages this way. – Dirk Eddelbuettel Jan 05 '15 at 03:36
3

I followed these instructions and everything worked!

sudo add-apt-repository ppa:marutter/rrutter
sudo apt-get update
sudo apt-get install r-base r-base-dev
Community
  • 1
  • 1
Filipe Ferminiano
  • 8,373
  • 25
  • 104
  • 174
  • 1
    Please delete this. It is not an answer, but at best a comment or maybe worth an edit of your question (but not *both* as well as an answer). It is also exactly what is in the README I pointed you to. – Dirk Eddelbuettel Jan 05 '15 at 12:28
  • if you can't complete the bing project let me know, it's getting urgent for me. – jayjay Feb 07 '16 at 12:44
0

You can find this resolved with this try this out:

# Install function for packages    
packages<-function(x) {    
  x<-as.character(match.call()[[2]])
  if (!require(x,character.only=TRUE)) {
    install.packages(pkgs=x,repos="http://cran.r-project.org")
    require(x,character.only=TRUE)
  }
}

packages(ggplot2)
packages(reshape2)
packages(plyr)
# etc ...other packages

that's all enjoy..!!

Mihriban Minaz
  • 3,043
  • 2
  • 32
  • 52