{"action":"created","issue":{"url":"https://api.github.com/repos/pablobarbera/Rfacebook/issues/25","labels_url":"https://api.github.com/repos/pablobarbera/Rfacebook/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/pablobarbera/Rfacebook/issues/25/comments","events_url":"https://api.github.com/repos/pablobarbera/Rfacebook/issues/25/events","html_url":"https://github.com/pablobarbera/Rfacebook/issues/25","id":58570695,"number":25,"title":"Error in content$data[[1]] : subscript out of bounds in getInsights","user":{"login":"theclue","id":1724406,"avatar_url":"https://avatars.githubusercontent.com/u/1724406?v=3","gravatar_id":"","url":"https://api.github.com/users/theclue","html_url":"https://github.com/theclue","followers_url":"https://api.github.com/users/theclue/followers","following_url":"https://api.github.com/users/theclue/following{/other_user}","gists_url":"https://api.github.com/users/theclue/gists{/gist_id}","starred_url":"https://api.github.com/users/theclue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theclue/subscriptions","organizations_url":"https://api.github.com/users/theclue/orgs","repos_url":"https://api.github.com/users/theclue/repos","events_url":"https://api.github.com/users/theclue/events{/privacy}","received_events_url":"https://api.github.com/users/theclue/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-23T10:55:48Z","updated_at":"2015-03-26T20:24:34Z","closed_at":null,"body":"Hello Pablo,\r\n\r\nfirst of all, tnx for your work..this package is really a lifeboat, to me!\r\n\r\nSaid that, I must say that I'm not able to make getInsights working. Whatever parameters I put, I always get this error: Error in content$data[[1]] : subscript out of bounds\r\n\r\nSome examples ->\r\n\r\nFrom a page I own:\r\n circle <- getInsights(object_id=\"9thcirclegames\", token = fb.connection, metric = \"page_impressions\")\r\n\r\n circle <- getInsights(\"me\", token = fb.connection, metric = \"page_impressions\")\r\n\r\nA post by me (not the page):\r\nexample_post <- circle <- getInsights(object_id=\"10152670074275267_10152659686895267\", token = fb.connection, metric = \"post_impressions\", period='days_28')\r\n\r\nperhaps I'm using the function in the wrong way?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/pablobarbera/Rfacebook/issues/comments/86699164","html_url":"https://github.com/pablobarbera/Rfacebook/issues/25#issuecomment-86699164","issue_url":"https://api.github.com/repos/pablobarbera/Rfacebook/issues/25","id":86699164,"user":{"login":"shenjunfei","id":10442627,"avatar_url":"https://avatars.githubusercontent.com/u/10442627?v=3","gravatar_id":"","url":"https://api.github.com/users/shenjunfei","html_url":"https://github.com/shenjunfei","followers_url":"https://api.github.com/users/shenjunfei/followers","following_url":"https://api.github.com/users/shenjunfei/following{/other_user}","gists_url":"https://api.github.com/users/shenjunfei/gists{/gist_id}","starred_url":"https://api.github.com/users/shenjunfei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shenjunfei/subscriptions","organizations_url":"https://api.github.com/users/shenjunfei/orgs","repos_url":"https://api.github.com/users/shenjunfei/repos","events_url":"https://api.github.com/users/shenjunfei/events{/privacy}","received_events_url":"https://api.github.com/users/shenjunfei/received_events","type":"User","site_admin":false},"created_at":"2015-03-26T20:24:34Z","updated_at":"2015-03-26T20:24:34Z","body":"I also have the same problem like you guys.\r\nEvery time I call getInsights():\r\n    insights <- getInsights(object_id = \"xxxxxxxxxx\", token = fb_oauth, metric = \"page_impressions\")\r\nan error is returned:\r\n    Error in content$data[[1]] : subscript out of bounds\r\n\r\nI also tried to debug this by \r\n    debug(getInsights)\r\nand execute the function line by line\r\n    function(object_id, token, metric, period = \"day\", n = 5) \r\nThe first line\r\n    url <- paste0(\"https://graph.facebook.com/\", object_id, \"/insights/\", metric, \"?period=\", period)\r\nand second line\r\n    content <- callAPI(url = url, token = token)\r\nare OK, but the error occurred when I browse to the third line\r\n    l <- length(content$data[[1]]$values)\r\n    Error in content$data[[1]] : subscript out of bounds\r\n\r\nIf I skip this and the following several lines about l\r\n    if (l == 0) {\r\n            stop(\"No public posts mentioning the string were found\")\r\n        }\r\nI finally get an output a few lines away here\r\n    if (length(content$data) == 0) {\r\n            stop(\"No public posts mentioning the string were found\")\r\n        }\r\n\r\nMaybe \"No public posts mentioning the string were found\" is exactly what I should get for this input?\r\n\r\n\r\nAnd the error says \r\n    Error in content$data[[1]] : subscript out of bounds\r\nIt seems to say that the first element of the first list content$data does not exist, because the list content$data is empty?\r\nActually after executing the following line\r\n    content <- callAPI(url = url, token = token)\r\nI find content is a list of 2, the first is data, and content$data is an empty list. Therefore content$data[[1]]$values does not exist and this line breaks down:\r\n    l <- length(content$data[[1]]$values)\r\nI'm wondering what is supposed to be in the list content$data when everything goes right, and what is wrong here."}}