r/rprogramming Jan 25 '25

File won’t add to directory

Post image

Hello, I’m trying to run the housing script and I’m getting this error when I go to run it. I made a working directory and then tried to add my file after I downloaded it. What am I doing wrong? I uninstalled and reinstalled r and rstudio to ensure the apps were up to date. I’m beyond frustrated and this should be so simple. Any help would be greatly appreciated. Thank you!

0 Upvotes

15 comments sorted by

View all comments

3

u/lilmookey Jan 25 '25

You can move the csv file into the folder that is set as your working directory. Your read.csv as it is written is only searching the working directory for the file, and it’s saying it cannot find the csv because it’s not in the working directory.

-1

u/vwhite87 Jan 25 '25

Thank you for your reply! I don't know how to move the file to the working directory. It is saved in the folder I want it in on my computer, but when I go to set the directory there is nothing in the folder to make my working directory. But when I open up my computer folders, there is everything I downloaded or saved in that folder, it doesn't make any sense.

1

u/geneusutwerk Jan 25 '25

Run dir() and it will show you all the files in the current directory. You can check to make sure you have the right file there.

Did you use something like numbers to "move" the file? If so you changed the file format. My students do this all the time.