Question: I created a folder in order for it to be the main work directory meaning all the files I create go there, and files I read will be from there.
For some reason after I created the folder and I'm trying to set it as the working directory I get this message:

```
Error in setwd("~/") : cannot change working directory  

```

When I try to create files they are saved somewhere different and I get an error when trying to load them. I used the `scan` function and got:

```
Error in file(file, "r") : cannot open the connection

```

In addition: Warning message:

```
In file(file, "r") : cannot open file 'ff': No such file or directory

```

Answer: 
This may help...
use the following code and browse the folder you want to set as the working folder

```
setwd(choose.dir())

```
I just had this error message happen. When searching for why, I figured out that there's a related issue that can occur if you're not paying attention - the same error occurs if the directory you are trying to move into does not exist.