Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in .External2(C_dataviewer, x, title) : unable to start data viewer

In R I get the following errors any time I hit View() or data.frame and I do not understand why. It happened suddenly.

> View(Fhat_all)
Error in .External2(C_dataviewer, x, title) : unable to start data viewer
In addition: Warning message:
In View(Fhat_all) : unable to open display

> da <- data.frame(comb[true_comb_RMSE[1],1], comb[true_comb_RMSE[1],2],
comb[true_comb_KS[1],1],comb[true_comb_KS[1],2])
Error in (function (env, objName)  : 
could not find function "object.size"

I checked this other page in Stackoverflow Can't use either View() or edit() functions, getting "Error in .External2(C_dataviewer, x, title) : invalid device" error message but I didn't understand how to fix it. So I hit locale on terminal and got this result:

Last login: Mon Mar 21 16:47:07 on ttys000
MacBook-Pro:~ "username"$ locale
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL=
MacBook-Pro:~ "username"$ LC_CTYPE = C R
-bash: LC_CTYPE: command not found

so I hit LC_CTYPE=C R on the the terminal as by suggestion and tried to view a vector in R, but I got the same error message:

> View(w)
Error in .External2(C_dataviewer, x, title) : unable to start data viewer
In addition: Warning message:
In View(w) : unable to open display

Can you please help me? Thank you.

like image 500
Andrew Avatar asked Oct 18 '22 13:10

Andrew


2 Answers

I had the same issue. I opened XQuartz and then the View() function worked.

like image 87
Victoria Avatar answered Oct 31 '22 00:10

Victoria


Experienced this after updating some packages.

Restart R worked for me (in RStudio: Ctrl+Shift+F10). After that, the error vanished and View worked well again.

like image 37
MS Berends Avatar answered Oct 30 '22 22:10

MS Berends