Skip to content

RStudio: Using View() is very slow

Stephanie Hazlitt edited this page Jan 22, 2018 · 6 revisions

Using View() and/or RStudio v1.1.336 in general is very slow in an Enterprise Environment

In RStudio View(iris) can be very slow - it can lock up RStudio for ~5-10s or more.

Run the following to find out your HOME directory:

$ echo $HOME

This returns /h/ - your Home drive on the network

If you run:

$ setx HOME $USERPROFILE (in bash)

OR

> setx HOME "%USERPROFILE%" (in CMD)

this sets HOME to c:/Users/[username], and it appears to fix the problem - View(iris) is now fast everywhere!

Caveat: It is likely that currently you have all of your dotfiles (.Rprofile, .Renviron, .gitconfig, .bashrc, etc.) in your H:/ (home network) drive because that is (has been) the HOME directory. If you set HOME to c:/Users/[username] as above, you will need to move all of your dotfiles there.

If you find that the data viewer in RStudio is causing other problems—for instance truncating the number of columns in a large data set—you could try using utils::View(my_data) instead.