{"id":1049,"date":"2022-04-04T20:37:45","date_gmt":"2022-04-05T01:37:45","guid":{"rendered":"https:\/\/poojanblog.com\/blog\/?p=1049"},"modified":"2022-04-04T20:39:40","modified_gmt":"2022-04-05T01:39:40","slug":"fixing-onedrive-annoyance-with-rstudio-on-windows","status":"publish","type":"post","link":"https:\/\/poojanblog.com\/blog\/2022\/04\/fixing-onedrive-annoyance-with-rstudio-on-windows\/","title":{"rendered":"Fixing OneDrive annoyance with Rstudio on Windows"},"content":{"rendered":"\n<p>By default, Rstudio on Windows with OneDrive installed stores packages in the OneDrive documents folder. This package location causes a lot of issues:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>It causes a lot of upload to OneDrive<\/li><li>It can cause conflicts between machines (since they will be storing to the same OneDrive folder)<\/li><li>It can cause unnecessary delays in having to download files from OneDrive (if they are not locally cached)<\/li><\/ol>\n\n\n\n<p>All in all, this location seems to be a poor side-effect of making OneDrive the default storage location on Windows. It can be easily rectified. Simply create a file called .Renvironment in &#8220;C:\\Users\\&lt;username>\\OneDrive\\Documents&#8221; (AKA your OneDrive documents folder) with the following line:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">R_USER=\"C:\/User\/&lt;username>\"<\/pre>\n\n\n\n<p>This one line redefines the user-specific directory to be on the local disk, in C:\\Users\\&lt;username>. This is the exact same place as the %USERPROFILE% environment variable on Windows. The site-wide .Rprofile will make use of this variable and create an package path using it as a base.<\/p>\n\n\n\n<p>These mechanisms <a href=\"https:\/\/support.rstudio.com\/hc\/en-us\/articles\/360047157094-Managing-R-with-Rprofile-Renviron-Rprofile-site-Renviron-site-rsession-conf-and-repos-conf\" data-type=\"URL\" data-id=\"https:\/\/support.rstudio.com\/hc\/en-us\/articles\/360047157094-Managing-R-with-Rprofile-Renviron-Rprofile-site-Renviron-site-rsession-conf-and-repos-conf\">are explained here<\/a>, and it is simpler than <a href=\"https:\/\/medium.com\/@ValidScience\/how-to-fix-rstudios-package-installation-on-windows-10-c1e602bf3a1f\" data-type=\"URL\" data-id=\"https:\/\/medium.com\/@ValidScience\/how-to-fix-rstudios-package-installation-on-windows-10-c1e602bf3a1f\">editing the site-wide .Rprofile as described here (and many other places)<\/a>, which would require you to repeat the procedure on new installations (and also requires modifying files in the base installation path).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default, Rstudio on Windows with OneDrive installed stores packages in the OneDrive documents folder. This package location causes a lot of issues: It causes a lot of upload to OneDrive It can cause conflicts between machines (since they will be storing to the same OneDrive folder) It can cause unnecessary delays in having to [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[246,245],"tags":[],"class_list":["post-1049","post","type-post","status-publish","format-standard","hentry","category-data-science","category-mba"],"jetpack_featured_media_url":"","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/poojanblog.com\/blog\/wp-json\/wp\/v2\/posts\/1049","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/poojanblog.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/poojanblog.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/poojanblog.com\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/poojanblog.com\/blog\/wp-json\/wp\/v2\/comments?post=1049"}],"version-history":[{"count":5,"href":"https:\/\/poojanblog.com\/blog\/wp-json\/wp\/v2\/posts\/1049\/revisions"}],"predecessor-version":[{"id":1055,"href":"https:\/\/poojanblog.com\/blog\/wp-json\/wp\/v2\/posts\/1049\/revisions\/1055"}],"wp:attachment":[{"href":"https:\/\/poojanblog.com\/blog\/wp-json\/wp\/v2\/media?parent=1049"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/poojanblog.com\/blog\/wp-json\/wp\/v2\/categories?post=1049"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/poojanblog.com\/blog\/wp-json\/wp\/v2\/tags?post=1049"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}