0

I want to load the data Facebook has related to my own profile into R. Though, when I run the code below, I end up with an empty dataframe. 1 Row referring to myself and 15 variables all giving NA's except for my id and name. The question is how do I get the data instead of NA's?

# Set up APP connection
install.packages("devtools")
library(devtools)

install_github("Rfacebook", "pablobarbera", subdir="Rfacebook")

require("Rfacebook")
fb_oauth <- fbOAuth(app_id="****", app_secret="*****", extended_permissions = TRUE)
save(fb_oauth, file="fb_oauth")
load("fb_oauth")

# Retrieve own user information
me <- getUsers("me",token=fb_oauth, private_info = TRUE)
my_likes <- getLikes(user="me", token=fb_oauth)
Floris
  • 11
  • 7
  • Since API v2.4, you need to explicitly ask for the fields you want, see http://stackoverflow.com/a/32585470/1427878 (How to do that with the framework you are using, is for you to look up.) – CBroe Sep 08 '16 at 10:04
  • Thanks a lot for your response. Though, in R this might work differently since each function mentions which arguments need to be entered and in the getUsers function it only asks for (users, token, private_info = TRUE). Meaning that there is no opportunity to fill them out seperately...@CBroe – Floris Sep 08 '16 at 10:15
  • You _need_ to specify the fields in your API request. If R isn’t capable of that, it would be useless for any apps that use an API version >= 2.4 – CBroe Sep 08 '16 at 10:51
  • @CBroe much appreciated your help! Found out that is was just that I had to substitute "me" for my Facebook ID. – Floris Sep 08 '16 at 11:24

0 Answers0