Getting error in file(file, “rt”): cannot open the connection

前端 未结 4 750
滥情空心
滥情空心 2021-01-22 14:04

I am running the following code...

#Create a list of all the files
file.list <- list.files(path=\"~/R/natural-language-processing/class-notes\", pattern=\".cs         


        
4条回答
  •  时光取名叫无心
    2021-01-22 14:47

    I just spent a lot of time trying to understand what was wrong on my code too...

    And it seems to be simple if you are using windows.

    When you name your file "blabla.txt" then windows name it "blabla.txt.txt"... That's the same with .CSV files so windows create a file named "001.csv.csv" if you called it "001.csv"

    So, when you create your .csv file, just rename it "001" and open it in R using read.table("/absolute/path/of/directory/with/required/001.csv")

    It works for me.

提交回复
热议问题