3

I am having some trouble installing the twitteR and RAOuth packages that are up on CRAN. I have tried a few different ways; under Windows from source, under Ubuntu using RStudio. I tried the following commands

sudo apt-get install r-cran-twitteR

or

install.packages("packagename", repos=NULL, type="source")

Using RStudio and from source under windows, I am getting a non-zero exit status message.

I have installed from source in the past, but my knowledge on the topic is fairly limited. Any help you can provide will be greatly appreciated.

Here is my system info:

R version 2.12.2 (2011-02-25)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i686-pc-linux-gnu (32-bit)
Btibert3
  • 38,798
  • 44
  • 129
  • 168

2 Answers2

3

You need to first ascertain whether a package exists:

 $ apt-cache search r-cran-twitter

will return nothing as it is not packaged. There are 2900+ packages on CRAN but 150 (give or take) on in Ubuntu as r-cran-*.

So in that you can you can either download from inside R, or use a browser or something like wget followed by R CMD INSTALL. My personal favourite is the script install.r that is an example in my littler package -- try sudo apt-get install littler if you want that.

Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
  • Thanks for the help Dirk. I installed your littler package using the command above, but this is where I am not sure where to go next. Any further help is much appreciated. – Btibert3 Apr 08 '11 at 01:58
  • Try `sudo cp /usr/share/doc/littler/examples/install.r /usr/local/bin/` followed by `sudo chmod 0755 /usr/local/bin/install.r`. Now you *could* say 'install.r twitteR` -- but there appears to be a missing Ubuntu package `liboauth-dev` so that will not complete. – Dirk Eddelbuettel Apr 08 '11 at 04:32
  • But you could still tweet the way my @CRANberriesFeed tweet feeds: using the `blt` command-line tool. See e.g. my blog post in early January. – Dirk Eddelbuettel Apr 08 '11 at 04:39
3

Do you have the system requirements fulfilled? If you try to install twitteR package, it will automatically try to install ROauth (since it's a suggested package), which depends on liboauth. You can download liboauth from http://liboauth.sourceforge.net/ (I don't see an Ubuntu package for it, but didn't look that hard).

If you do that, I suspect it will install ok. It's worth saying that I never got the new ROauth package to work despite a successful (and tested) liboauth installation - always got a "Server did not respond" error. I am about to release a fully R-native oauth package in the next week. I could use beta testers - email me (in profile) if you'd like a sneak peak.

Noah
  • 2,574
  • 1
  • 18
  • 12