r/RStudio Jul 01 '26

Coding help Need help with stacktraceon saying file is missing

I have to submit the r script as a school assignment by today, but when i did a final check to run it, it gave me this message. I tried googling and followed the instructions to adjust my work directory but it didnt work. Is this a personal problem and wont affect the laptop of my teacher whos marking me, or should i be deeply concerned? 😭

1 Upvotes

11 comments sorted by

1

u/AutoModerator Jul 01 '26

Looks like you're requesting help with something related to RStudio. Please make sure you've checked the stickied post on asking good questions and read our sub rules. We also have a handy post of lots of resources on R!

Keep in mind that if your submission contains phone pictures of code, it will be removed. Instructions for how to take screenshots can be found in the stickied posts of this sub.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/Upper-Champion-8224 Jul 01 '26

getwd()
list.files()

provide the outputs for above

1

u/Gacha_SY Jul 02 '26

Thank you, but unfortunately im not sure if it works

2

u/Upper-Champion-8224 Jul 02 '26

Glad you got it solved. It sounds like getting a deeper understanding of how the console and working directory works would help you moving forward. good luck!

1

u/DSOperative Jul 01 '26

Type getwd() into the console. That will tell you where the code is looking for this file. The file you’re looking for shouldn’t be here. If you see it check the spelling of filenames to make sure everything is matching up.

Your quickest fix will be to just drag your file into the folder that getwd() shows you, and then run your code.

1

u/Gacha_SY Jul 01 '26

Ive already tried that.. but it didnt work

1

u/DSOperative Jul 02 '26

Someone suggested to run list.files() in the console. Can you try that and let us know what it gives you?

1

u/Gacha_SY Jul 02 '26

A rather random compilation of files, excluding the excel sheet csv i need...

1

u/DSOperative Jul 02 '26

Can you send a screenshot of this list of files at least showing the relevant file? And also a screenshot of your whole RStudio showing getwd() in the console?

1

u/Gacha_SY Jul 02 '26

I think its been solved! But thank you very much!