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: 
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.
Maybe it is the case that you have your path in couple of lines, you used enter to make it? If so, then part of you paths might look like that "/\nData/" instead of "/Data/", which causes the problem. Just set it to be in one line and issue is solved!