<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/make-rstudio-look-the-way-you-want-because-beauty-matters/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://www.statworx.com/de/blog/make-rstudio-look-the-way-you-want-because-beauty-matters/"> r-bloggers – STATWORX</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<h2>Introduction</h2>
<p>RStudio is a powerful IDE that helped me so many times with conveniently <a rel="nofollow" href="https://www.statworx.com/blog/fehlerbehandlung-in-r-debugging-mit-rstudio/" target="_blank">debugging</a> large and complex R programs as well as shiny apps, but there is one thing that bugs me about it: there is no easy option or interface in RStudio that lets you customize your theme, just as you can do in more developed text editors such as Atom or <a rel="nofollow" href="https://www.statworx.com/blog/compiling-r-code-in-sublime-text/" target="_blank">Sublime</a>. This is sad, especially if you like working with RStudio but are not satisfied with its appearance. That being said, I did some research on how to customize its themes by hand with a little hack! Here you go!</p>
<h2>Customizing your theme</h2>
<p>Well, before we get started, I've got some sad news for you: first, I use a Mac, so all the instructions pertain to that platform. However, I think things should work similarly when having Windows on your computer. Second, you have to sacrifice one of RStudio's built-in editor themes, so choose wisely. In the end, what we will do is overwriting the settings of one theme with your own preferences. For the sake of demonstration, I will do that with the <em>dawn</em> editor theme in RStudio version 1.1.419. To understand what will be going on, be aware that the RStudio IDE in fact works like a browser and the styles and themes you have at your hand are essentially css files lying somewhere in your file system. We will eventually access those files and change them.</p>
<h2>First step: Change a theme until you like it</h2>
<p>Let's go now and look at the dawn theme.<img alt="dawn theme" src="https://i1.wp.com/www.statworx.com/wp-content/uploads/dawn-theme.png?w=450&ssl=1" class="wp-image-13767" data-recalc-dims="1"></p>
<p>Now, if you want to experiment with changing it, recall that RStudio actually is a browser, so right-clicking somewhere in the text editor and selecting &quot;Inspect Element&quot; should open the HTML the editor is based on. </p>
<p><img alt="href to css" src="https://i0.wp.com/www.statworx.com/wp-content/uploads/href-to-css.png?w=450&ssl=1" class="wp-image-13770" data-recalc-dims="1"><br>
Scroll down until you find the <code></code> tag referencing a css file. There is a path in the <em>href</em> argument. You should remember the filename of the corresponding css file, because we will change that file on our file system later. Simply click on the path to the css file to view its content.</p>
<p><img alt="old theme overview" src="https://i1.wp.com/www.statworx.com/wp-content/uploads/old-theme-overview.png?w=450&ssl=1" class="wp-image-13773" data-recalc-dims="1"></p>
<p>Perfect! Now, you can mess around with the css selectors' attributes and view the result on the theme in real time (unfortunately, you cannot rearrange the selectors)! As an example, I will change the selector <strong>.ace_comment</strong> which defines the physical appearance of comments in the code. Let's say I don't like it being italic and I want to change the color to be a bit more … noticeable. That's why I decide to make the font bold and change the color to red. Furthermore, I add another attribute <code>font-size</code> to make the text larger.</p>
<p>This is what it looked like before …</p>
<p><img alt="comment old" src="https://i0.wp.com/www.statworx.com/wp-content/uploads/comment-old.png?w=450&ssl=1" class="wp-image-13764" data-recalc-dims="1"></p>
<p>… and this is what it looks like now ….</p>
<p><img alt="comment new" src="https://i0.wp.com/www.statworx.com/wp-content/uploads/comment-new.png?w=450&ssl=1" class="wp-image-13761" data-recalc-dims="1"></p>
<h2>Second step: Overwrite the theme on your file system</h2>
<p>So far, we have temporarily changed the theme. If you reopen RStudio, everything is gone. This can be handy if you just want to play around. However, we want to make things permanent, which is our next step.</p>
<p>As I have already mentioned, an editor theme in RStudio essentially is a css file lying somewhere on your computer, so all R themes can be accessed through your file system. Simply navigate on the program folder with your finder, right-click on the RStudio logo and click on &quot;show package content&quot; (or something similar to that; sorry, my system language is German ;)).</p>
<p><img alt="RStudio show package content" src="https://i2.wp.com/www.statworx.com/wp-content/uploads/rstudio-show-package-content.png?w=450&ssl=1" class="wp-image-13779" data-recalc-dims="1"></p>
<p>You should now find yourself in the directory <em>Contents</em>. Next, navigate to the css files as shown below</p>
<p><img alt="path to css" src="https://i1.wp.com/www.statworx.com/wp-content/uploads/path-to-css.png?w=450&ssl=1" class="wp-image-13776" data-recalc-dims="1"></p>
<p>If you change the file corresponding to the dawn theme (97D3C…9C49C5.cache.css), you will have permanently changed that theme.</p>
<h2>Conclusion</h2>
<p>Customizing RStudio themes requires some little tricks, but it is definitely doable. Please keep in mind that any changes you make when inspecting the editor theme will only be temporary. To make changes permanent, take a look at what theme you want to overwrite, search its corresponding css file name, and enter your changes there. </p>
<p>If you like the Atom theme &quot;One Dark&quot; and you would like to have it as a RStudio theme, you can find it on my <a rel="nofollow" href="https://github.com/tkrabel/rstudio_atom_theme" target="_blank">GitHub account</a>. Simply rename it to the css file you want to replace and put it in RStudio's theme folder. As a little teaser: this is what it looks like:</p>
<p><img alt="atom theme rstudio" src="https://i2.wp.com/www.statworx.com/wp-content/uploads/atom-theme-rstudio.png?w=450&ssl=1" class="wp-image-13758" data-recalc-dims="1"></p>
<div>
<h6>About the Author</h6>
<p><img src="https://i1.wp.com/www.statworx.com/wp-content/uploads/tobias-2-300x300.jpg?resize=180%2C180&ssl=1" width="180" alt="Tobias Krabel" class="wp-user-avatar wp-user-avatar-180" data-recalc-dims="1" height="180"></p>
<div>
<h4>Tobias Krabel</h4>
<p>Tobias ist im Data Science Team und absolviert im Moment seinen 2. Master in Informatik. In seiner Freizeit ist er sozial engagiert und geht gerne Wandern in der Natur.</p>
</div>
</div>
<p>Der Beitrag <a rel="nofollow" href="https://www.statworx.com/de/blog/make-rstudio-look-the-way-you-want-because-beauty-matters/" target="_blank">Make RStudio Look the Way You Want — Because Beauty Matters</a> erschien zuerst auf <a rel="nofollow" href="https://www.statworx.com/de" target="_blank">STATWORX</a>.</p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://www.statworx.com/de/blog/make-rstudio-look-the-way-you-want-because-beauty-matters/"> r-bloggers – STATWORX</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/FYx2Y1c6IXE" height="1"></a></div>