尝试使用ROAuth访问Fitbit时出现strsplit错误 [英] strsplit error when attempting to access Fitbit with ROAuth
本文介绍了尝试使用ROAuth访问Fitbit时出现strsplit错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用ROAuth访问fitbit API,但始终处于第一个障碍.
I am attempting to access the fitbit API using ROAuth but keep falling at the first hurdle.
这是我的代码:
library(ROAuth)
reqURL <- "https://api.fitbit.com/oauth/request_token"
accessURL <- "https://api.fitbit.com/oauth/access_token"
authURL <- "https://www.fitbit.com/oauth/authorize"
cKey <- "xxxxx"
cSecret <- "xxxxx"
credentials <- OAuthFactory$new(consumerKey=cKey,
consumerSecret=cSecret,
requestURL=reqURL,
accessURL=accessURL,
authURL=authURL)
credentials$handshake()
运行此命令会产生以下相当隐秘的错误:
Running this gives the following rather cryptic error:
Error in strsplit(response, "&") : non-character argument
任何建议,不胜感激!
推荐答案
遵循@ hadley 的建议,而不是解决ROAuth
问题,我改用了httr
包. 此问题中的代码对我有用.
Following the suggestion of @hadley rather than solving the ROAuth
problem, I have switched to using the httr
package instead. The code in this question worked for me.
这篇关于尝试使用ROAuth访问Fitbit时出现strsplit错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文