r
2016-12-22 144 views 0 likes 
0

私は小さな変化でhereからGoogle Analyticsの認証のためのスクリプトを使用します。R:ファイル名、ディレクトリ名、またはボリュームラベルの構文が正しくありません

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" 
) 

そしてexeption取得:

> 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 

ファイルを作業ディレクトリにあります。ファイル名が正しい。 OSはWindows 10です。 解決策が見つかりません。助けてください。

UPD。 機能からの除外結果:

>normalizePath(path.expand('humbertoharbert.json')) 
[1] "C:\\seo_bi\\humbertoharbert.json" 
+0

'path'は何を返しますか? – dreamer

+0

スラッシュをバックスラッシュ(C:\ seo_bi)にする必要はありませんか? – mpjdem

+0

私は、例外から機能付き投稿を更新します。 –

答えて

0

サービスアカウントファイルにバグがありました。そこにはprivate_keyはありませんでした。 jsonファイルを正しいものに変更しました。

+0

と修正されたjsonは何ですか?問題がなければ共有できますか? – mannedear

+0

この構造は私のために働くhttp://img.netpeak.ua/kutasok/vzlG9-2018-01-29.png –

関連する問題