【问题标题】:R: The filename, directory name, or volume label syntax is incorrectR:文件名、目录名或卷标语法不正确
【发布时间】: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"

【问题讨论】:

标签: r


【解决方案1】:

服务帐户文件存在错误。里面没有 private_key。我将 json 文件更改为正确的文件,现在脚本可以工作了。

【讨论】:

  • 那修正后的 json 是什么?,如果没有问题可以分享一下吗?
猜你喜欢
  • 2014-06-30
  • 2019-05-24
  • 2019-09-30
  • 2018-10-31
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-05
相关资源
最近更新 更多