-1

I am having trouble with Rfacebook- I install it, which seems to go fine, but then when I call fbOAuth exactly as I've seen in examples, it says function not found. I wonder if my directories/libraries/working spaces aren't lined up? It's showing a temporary location but I also see an Rfacebook folder get created in my designated library.

Thanks!

package ‘Rfacebook’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in C:\Users\Katherine\AppData\Local\Temp\Rtmp23Rk2g\downloaded_packages

> fb_oauth <- fbOAuth(app_id="xxxxx", app_secret = "xxxxx")
Error: could not find function "fbOAuth"
Avinash Raj
  • 172,303
  • 28
  • 230
  • 274
  • Have you done `library(Rfacebook)` before running that command? – nacnudus Dec 29 '14 at 00:58
  • Also, +1 to correct harsh downvoting, which the OP is unlikely to understand. There's no mention of needing to use `library()` either in the help page for `?install.packages` or the error description, to get the [canonical answer](http://stackoverflow.com/a/7027332/937932) you have to search for the error but leave out 'fbOAuth', and the OP has made a reasonable guess about temp folders, so I'm prepared to give the benefit of the doubt. – nacnudus Dec 29 '14 at 01:08
  • technically, you're not supposed to upvote in response to downvoting; upvote if you like the question on its own merits ... – Ben Bolker Dec 29 '14 at 03:40

1 Answers1

2

This is R FAQ 7.30; I would have expected it is also duplicated on SO somewhere but can't find it at the moment.

You need

library("Rfacebook")  ## quotation marks optional but recommended

You need to run this command every time you start a new R session (or add it to your .Rprofile file), but you only need to install the package once (for every machine/R installation you use).

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453