【发布时间】:2016-12-22 09:14:59
【问题描述】:
我使用来自here 的 Google Analytics 身份验证脚本进行了一些小改动:
library(googleAuthR)
library(googleAnalyticsR)
setwd("C:/seo_bi")
file.exists('humbertoharbert.json')
gar_auth_service(
json_file = 'humbertoharbert.json',
scope = "https://www.googleapis.com/auth/analytics"
)
得到一个例外:
> file.exists('humbertoharbert.json')
[1] TRUE
> gar_auth_service(
+ json_file = 'humbertoharbert.json',
+ scope = "https://www.googleapis.com/auth/analytics"
+ )
Error in normalizePath(path.expand(path), winslash, mustWork) :
path[1]="": The filename, directory name, or volume label syntax is incorrect
文件在工作目录中。文件名是正确的。操作系统为 Windows 10。 找不到解决方案。请帮忙。
UPD。 异常函数的结果:
>normalizePath(path.expand('humbertoharbert.json'))
[1] "C:\\seo_bi\\humbertoharbert.json"
【问题讨论】:
-
path返回什么? -
斜线不应该是反斜线,即 C:\seo_bi 吗?
-
我用异常的功能更新了帖子。
-
gar_auth_service函数源码在这里github.com/MarkEdmondson1234/googleAuthR/blob/…
-
大写和 normalizePath bugs.r-project.org/bugzilla3/show_bug.cgi?id=16369 看起来确实存在问题
标签: r