Forum Discussion
Error in RStudio when setting directory
Hi i´m not sure if this is the exact forum to solve this issue, but i´m currently doing a free online course on PowerBI and i got into this class where we learn some basic R language to use the program with when i ran into this error while using RStudio:
setdw("C:/Users/Victor/Desktop/PowerBI/VendasR.csv")
Error in setdw("C:/Users/Victor/Desktop/PowerBI/VendasR.csv") :
could not find function "setdw"
I´m not a programmer and tried googling this out to no avail. Any help is appreciated.
Hi VBeaklini ,
Your working directory seems to be pointing to a file?
Please change it to a folder, such as: setwd("C:/Users/Victor/Desktop/PowerBI/")
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
5 Replies
- v-jianboli-msftCommunity Support
Hi VBeaklini ,
Your working directory seems to be pointing to a file?
Please change it to a folder, such as: setwd("C:/Users/Victor/Desktop/PowerBI/")
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- v-jianboli-msftCommunity Support
Hi VBeaklini ,
It seems that you want to use setwd() function?
The setwd() function stands for set working directory. This is used to set the working environment.
Please check your spelling, it is setwd() not setdw()
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- VBeakliniHelper I
Holy crap i´m so dumb. Thanks.
However now that i set thing correctly i now run into this new error:
setwd("C:/Users/Victor/Desktop/PowerBI/VendasR.csv")
Error in setwd("C:/Users/Victor/Desktop/PowerBI/VendasR.csv") :
cannot change working directoryAny thoughts?
- v-jianboli-msftCommunity Support
Hi VBeaklini ,
There can be a lot of reasons for which such an error might occur in R. Some of the reasons are the following:
- When the file path name is misspelled.
- Invalid characters are used in the file path.
- We do not have permission to access a particular file path.
- File exists but there are some other restrictions that exist for compilers.
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- VBeakliniHelper I
Okay, it can´t be the first two since i read and reread and corrected and recorrected it so many times. As for permission to access a file and compiling restrictions, how do i check for those? It´s a simple file in a simple folder on my personal computer, so there shouldn´t be any issues regarding permission. As for compilers, i don´t know what that means.