RStudio is slow when loading a project / package in development - r

I have recently experienced a serious problem with Rstudio when developing a package. Whenever, I open an existing project with Rstudio where versions are controlled with Git, it takes so long for it to respond to any command. It is also impossible to type something in the console (e.g. 1+1) and obtain the result. Even quitting the Rstudio, should be done with task manager. There is no problem when I create a new project / package or when I open directly a R script.
This problem appears both when the project is saved on a dropbox or on a local repository.
To overcome this issue everytime I need to modify my code, I create a new project, and then I move toward the new repository all my current R scripts and the folder ".git".
I would appreciate if anybody could help me with this issue.

I had a similar problem to yours. Changing the attribute of my .git folder into hidden solved my problem.
We recently discovered an issue where projects using git for version control could become laggy / unusable on Windows if the .git folder within the project had become a non-hidden directory.
https://github.com/rstudio/rstudio/issues/1918

Related

RStudio hangs for a specific project. What file needs to be changed?

I have a project that I've been working on for several months without a problem. Yesterday I tried to profile a bit of code using the raster package that was taking a very long time to run. I left it running overnight and found RStudio unresponsive in the morning. Now when I open that project, I can't do anything except to force quit RStudio. Other projects appear to work fine.
I suspect something bad is stored in the file(s) that remembers where I was. Is there one or more that I can delete and regain control of the project. Candidates in the project folder would seem to be one or more items in the .Rproj.user directory.
I found a tip on the RStudio website. In a terminal, navigate to the project directory and rename .Rproj.user to something different. I used this command - mv .Rproj.user .Rproj.user_old. This keeps the user-specific information around in case you want to go back to it.

R studio not responding

My RStudio is opening multiple processes(opening R Studio in different windows) when I open just one. I am not able to open any project. It becomes unresponsive. I tried using in compatibility mode, running as admin and also uninstalled. But still,(here's the image) the same problem persists. Can someone please help me?
Before you reinstall everything, which may take a lot of time, it is worth removing application data, which is a cache R keeps of last sessions etc. It involves settings such as information from last session, etc which RStudio tries to reopen every time you open it.
For app data, look under your user folder which must be somewhere like
c:\Users\<your_user_here\AppData\Local
c:\Users\<your_user_here\AppData\Local\LocalLow
c:\Users\<your_user_here\AppData\Roaming
Delete every subfolder called R, RStudio-Desktop or RStudio under these folders. Don't worry, you won't lose your source program files and projects. It may help you recover everything without having to start over from scratch.

How to make sure the user of a shiny app is using the right package versions in R

Due to recent experience with several bugs created by updating packages, I wonder what the best approach is for the following problem:
I currently provide a stand alone version so to say of my shiny App (just the script files to run it locally) and run a long list of require() functions to load / install the needed packages. However, in the end I would like to use fixed package versions to avoid bugs created by changes in packages.
Is there a way to ensure that the user, who may have older or newer versions of packages on their computer, is using the right version of all the packages my app needs?
You can consider using packrat: https://rstudio.github.io/packrat/.
Unfortunately, private libraries don’t travel well; like all R
libraries, their contents are compiled for your specific machine
architecture, operating system, and R version. Packrat lets you
snapshot the state of your private library, which saves to your
project directory whatever information packrat needs to be able to
recreate that same private library on another machine.
Short tutorial:
RStudio - File - New Project - New Directory - New Project - "Do: use Path" - Create Project
Enter in the R(Studio) console:
Code:
packrat::init()
.libPaths() # test if libpath has changed
install.packages("reshape2") # installs within one of the packrat libpaths
Installing package into ‘C:/R/packRatTest/packrat/lib/x86_64-w64-mingw32/3.4.3’
Assumption would be that you can use and share RStudio Projects, but i think it would be hard to work without them anyway ;).
Try writing your shiny app as a package. You can, somewhat, control that through the description file.
Since you said you're using script take a look at: https://github.com/chasemc/electricShine
Even of you don't use it, hopefully looking at the code will help for things like setting the download repo to be a specific MRAN date.

some issue with using atom sync-settings tool

With the risk of me misunderstanding something, I can't get my packages to sync. I went through the following scenario:
I install new packages on Machine 1 and upload the settings through the "Sync Backup" command in atom. I can see that the new packages are listed in the packages.json file in the gist.
On Machine
I restore the settings and can indeed see settings being restored, like keymaps. However I don't get my new packages. I have restarted and reloaded Atom without luck.
Are there any extra steps I need to take to get the new packages on Machine 2?
You can try atom-package-sync. It is a package that I created a couple weeks ago. It works a little bit like the synchronization of Google Chrome, you just login and it syncs your packages and settings automatically across all your Atom instances. It is based on package-sync but I find it easier to use.

Rstudio opens all files in package after build

Every time I build my package after a modification, R studio will display every file in the package as untitled, and I have to close them and reopen them in order to modify files before another build. To be honest, it doesn't affect functionality that much, but is annoying and can sometimes cause Rstudio to crash.
Has anyone seen this before, and can suggest a fix?
I would post a screenshot, but I am new to stackoverflow and don't have enough reputation (10).
I haven't figured out what caused the problem, but I was able to solve it by deleting all the project files produced by Rstudio (.RProj.user, packagename.Rproj, .Rhistory, .Rbuildignore), and then creating a new project in the existing directory.

Resources