1

Whenever I try to set the working directory I get an error message that says

Error in setwd("/Users/myname/Wedding\u2069") : 
  cannot change working directory

Specifically, the directory path is followed by "u2069"

I am working from a Mac. Any suggestions?

Danny
  • 554
  • 1
  • 6
  • 17
  • Strange. `\u2069` seems to suggest Unicode character ["Pop Directional Isolate"](https://www.fileformat.info/info/unicode/char/2069/index.htm), which may originate from using different text base directions. Can you provide more details involving your OS, locale and language settings? – Maurits Evers Aug 07 '19 at 02:22
  • I'm using Mac Mojave OS, am based in the United States, with English as the language. This is the first time this has happened to me. – Danny Aug 07 '19 at 02:36
  • try using `/` instead of `\ `? – morgan121 Aug 07 '19 at 02:46
  • So is `u2069` actually the name of a folder? In that case, see @RAB's advice. – Maurits Evers Aug 07 '19 at 02:50
  • That didn't work. Received this message: "Error: '\U' used without hex digits in character string starting ""\U"" – Danny Aug 07 '19 at 02:51
  • u2069 isn't the name of the folder. The directory entered was this: "setwd("/Users/myname/Wedding"). The error message added the u2069 and reported this: Error in setwd("/Users/myname/Wedding\u2069") : cannot change working directory – Danny Aug 07 '19 at 02:54
  • That's very odd; so the `\u2069` really does seem to relate to the afore-mentioned Unicode character. Did you add support for multiple input sources on your Mac and switch between them? – Maurits Evers Aug 07 '19 at 06:02
  • Also: Does the problem persist when you restart your Mac and open a fresh R session from the terminal? – Maurits Evers Aug 07 '19 at 06:03

1 Answers1

0

I had an identical problem running R 3.6.2. on a Mac. Deleting the apostrophe or quotation characters around the working directory, typing them in again and then running the command worked. I can't quite explain it, but this does appear to be some sort of encoding/formatting problem.

mkt
  • 437
  • 7
  • 20