Trying to load an .csv file. I get the following error messages when trying to load not only this file ( resourcecurse.csv
) but also other files in the same file location (which I was able to load previously using read.csv("filename.ext")). I've tried read.csv(), load(), and readRDS(), but may be using them incorrectly.
1.
# set working directory
setwd("~/Documents/PolSci/Quan/RStudio")
curse <- read.csv("resourcecurse.csv")
Error message:
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
cannot open file 'resourcecurse.csv': No such file or directory
2.
load("data/resourcecurse.csv")
Error message:
Error in load("data/resourcecurse.csv") :
bad restore file magic number (file may be corrupted) -- no data loaded
In addition: Warning message:
file ‘resourcecurse.csv’ has magic number 'count'
Use of save versions prior to 2 is deprecated
3.
In gzfile(file, "rb") :
Error message:
Error in gzfile(file, "rb") : cannot open the connection
In addition: Warning message:
In gzfile(file, "rb") :
cannot open compressed file 'resourcecurse.csv', probable reason 'No such file or directory'
My r version is 4.2.1
, and RStudio version is 2022.07.2 Build 576
.
Thank you kind internet people.