任何人都可以提供更新的文档,以便将R与Fusion Tables 1.0 API连接起来吗?
旧包装: http://andrei.lopatenko.com/rstat/fusion-tables.R
我试图了解如何使用API密钥对Fusion Tables进行SQL调用。在成功连接客户端登录后,运行以下代码将返回" Forbidden"。
ft.executestatement <- function(auth, statement) {
url = "https://www.googleapis.com/fusiontables/v1/query"
params = list( sql = statement, key = "XXXXXXX")
connection.string = paste("GoogleLogin auth=", auth, sep="")
opts = list( httpheader = c("Authorization" = connection.string))
result = postForm(uri = url, .params = params, .opts = opts)
if (length(grep("<HTML>\n<HEAD>\n<TITLE>Parse error", result, ignore.case = TRUE))) {
stop(paste("incorrect sql statement:", statement))
}
return (result)
}
非常感谢任何方向。