エラー: ""C:\U" で始まる文字列の中で 8 進文字なしに '\U' が使われています

Windows8.1に入れたRでcsvファイルを読み込もうと思ったときに出てきたエラー。

原因となったコマンド
data_file=read.csv("C:\Users\dir_path\pp20180704.csv")

解決策
\ではなく、/を使う。
(ファイルパスをプロパティとかからそのままコピーしてくると\になっちゃう)

data_file=read.csv("C:/Users/dir_path/pp20180704.csv")
こうしたらうまくいきました。

コメント

このブログの人気の投稿

TypeError: ufunc 'bitwise_xor' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

overleafで画像が表示されない!