我正在使用map()
以下代码从 Facebook 获取发布数据:
posts_data <- map(posts$query_id, getPost, token = fb_oauth, n = 1000)
但是,有些query_id
观察结果不正确,或者是共享事件,API 无法检索这些事件并给我一个错误,例如:
Error in callAPI(url = url, token = token, api = api) :
Unsupported get request. Object with ID '1816137521765810_1832190963493790' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api
我知道我可以possibly()
在为这些错误返回输出的同时继续进行调用,这样函数就不会停止。但我不知道如何一起使用possibly()
and map()
,因为 possible() 只接受一个函数作为参数,并且不允许我向该函数传递额外的参数。