Can't use either View() or edit() functions, getting "Error in .External2(C_dataviewer, x, title) : invalid device" error message

The problem might be your locale settings. Run command 'locale' from terminal and see if there are any lines with something else but 'C' locale. For example, in my case output is like this:

macbook:foo user$ locale
LANG=
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

Easiest way to solve this is to set the locale to be C for just the R process ie. run R from terminal session with command 'LC_CTYPE=C R' instead of just 'R'. At least on OS/X 10.6.8 this gets rid of the error messages and allows R to display the edit window.

Tags:

R