Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
VBeaklini
Helper I
Helper I

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.

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community 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.

View solution in original post

5 REPLIES 5
v-jianboli-msft
Community Support
Community 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-msft
Community Support
Community 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.

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.

v-jianboli-msft
Community Support
Community 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.

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 directory

 

Any thoughts?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.