0
我剛剛在我的計算機上安裝了Ubuntu,並且正在重新運行以前在Windows中工作的一些代碼。我用我的所有文件將我的目錄複製到Ubuntu中。在Ubuntu中使用read.csv將csv導入到R中
當我運行這行代碼導入數據庫爲R,我得到以下錯誤:
Annot <- read.csv("~/Documents/DATABASES/Functional_Annotations/Salar_2_Annot_light.csv", header = TRUE)
Error in file(file, "rt") : cannot open the connection
In addition: Warning message: In file(file, "rt") : cannot open file
'/home/cd46/Documents/DATABASES/Functional_Annotations/Salar_2_Annot_light.csv':
No such file or directory
的代碼是正確的,並沒有因爲之前改變。事實上,如果我運行:
setwd("~/Documents/DATABASES/Functional_Annotations")
它工作正常,並識別目錄。還有它的文件。
我不確定這是什麼,有沒有人有建議?我做的唯一的事情就是切換到Ubuntu,所以我會想象這個問題會在那裏。
它是否工作到'setwd',然後只是'read.csv'上沒有完整路徑的文件名? – Thomas
什麼'path.expand(「〜/ Documents/DATABASES/Functional_Annotations」)'告訴你? – hrbrmstr
使用'ls -l'來檢查分配給CSV文件的訪問權限 –