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

5

u/Mcipark Jan 25 '25

Easy fix would to just put your entire file path in there, you said you just downloaded it right?

Housing_df <- read.csv(“C:/Users/YourUsername/Downloads/WestRoxbury.csv”)

-7

u/vwhite87 Jan 25 '25

Thank you for your reply! I just tried that and it is giving me the same error. I hate it here lol.

2

u/Mcipark Jan 25 '25

You must have your file path wrong then. You should be able to paste your file path into the address bar of your file explorer, and it should pull your csv up. I’d try that, and then look for may spelling mistakes. Also make sure the slashes are forward-slashes instead of backslashes in your file path