
Rでcsvファイルを読み込もうとしたら、下記エラーメッセージ↓。
Error in file(file, "rt") : cannot open the connection
ちょっと困って、下記を参考にして
I'm new to R, and after researching this error extensively, I'm still not able to find a solution for it. Here's the code. I've checked my working directory, and made sure the files are in the right
directory <- ("./フォルダ名")
から
directory <- ("./フォルダ名/")
に変更したり、

作業ディレクトリを一個上の階層に変更したりしたけど、


解決せず。
不思議なのは、
file.exists("../フォルダ名/ファイル名.csv")
で調べたらちゃんとファイルの存在を認識してくれているのに、
それをコピペして
Data <- read.csv("../フォルダ名/ファイル名/")
としたら
Error in file(file, "rt") : cannot open the connection
が出てくる……。
うーん……とりあえず普通にファイルを作業ディレクトリと同じ場所に置いて、シンプルに
Data <- read.csv("ファイル名.csv")
としたら読み込んでくれた。
ちゃんと理解できなかったけど、解決したから先に進もう。