<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>RStudio on R Views</title>
    <link>https://rviews.rstudio.com/tags/rstudio/</link>
    <description>Recent content in RStudio on R Views</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 10 Mar 2021 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://rviews.rstudio.com/tags/rstudio/" rel="self" type="application/rss+xml" />
    
    
    
    
    <item>
      <title>Cheat Sheets</title>
      <link>https://rviews.rstudio.com/2021/03/10/rstudio-open-source-resorurces/</link>
      <pubDate>Wed, 10 Mar 2021 00:00:00 +0000</pubDate>
      
      <guid>https://rviews.rstudio.com/2021/03/10/rstudio-open-source-resorurces/</guid>
      <description>
        &lt;p&gt;In a &lt;a href=&#34;https://rviews.rstudio.com/2020/12/02/learn-and-teach-r/&#34;&gt;previous post&lt;/a&gt;, I described how I was captivated by the virtual landscape imagined by the RStudio education team while looking for resources on the &lt;a href=&#34;https://rstudio.com/&#34;&gt;RStudio&lt;/a&gt; website. In this post, I&amp;rsquo;ll take a look at
&lt;a href=&#34;https://rstudio.com/resources/cheatsheets/&#34;&gt;&lt;em&gt;Cheatsheets&lt;/em&gt;&lt;/a&gt; another amazing resource hiding in plain sight.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;cs.png&#34; height = &#34;400&#34; width=&#34;100%&#34;&gt;&lt;/p&gt;

&lt;p&gt;Apparently, some time ago when I wasn&amp;rsquo;t paying much attention, cheat sheets evolved from the home made study notes of students with highly refined visual cognitive skills, but a relatively poor grasp of algebra or history or whatever to an essential software learning tool. I don&amp;rsquo;t know how this happened in general, but master cheat sheet artist Garrett Grolemund has passed along some of the lore of the cheat sheet at RStudio. Garrett writes:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;One day I put two and two together and realized that our Winston Chang, who I had known for a couple of years, was the same &amp;ldquo;W Chang&amp;rdquo; that made the LaTex cheatsheet that I&amp;rsquo;d used throughout grad school. It inspired me to do something similarly useful, so I tried my hand at making a cheatsheet for Winston and Joe&amp;rsquo;s Shiny package. The Shiny cheatsheet ended up being the first of many. A funny thing about the first cheatsheet is that I was working next to Hadley at a co-working space when I made it. In the time it took me to put together the cheatsheet, he wrote the entire first version of the tidyr package from scratch.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It is now hard to imagine getting by without cheat sheets. It seems as if they are becoming expected adjunct to the documentation. But, as Garret explains in the &lt;a href=&#34;https://github.com/rstudio/cheatsheets&#34;&gt;README&lt;/a&gt; for the cheat sheets GitHub repository, &lt;strong&gt;they are not documentation!&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;RStudio cheat sheets are not meant to be text or documentation! They are scannable visual aids that use layout and visual mnemonics to help people zoom to the functions they need. &amp;hellip; Cheat sheets fall squarely on the human-facing side of software design.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Cheat sheets live in the space where &lt;a href=&#34;https://psnet.ahrq.gov/primer/human-factors-engineering&#34;&gt;human factors&lt;/a&gt; engineering gets a boost from artistic design. If R packages were airplanes then pilots would want cheat sheets to help them master the controls.&lt;/p&gt;

&lt;p&gt;The RStudio site contains sixteen RStudio produced cheat sheets and nearly forty contributed efforts, some of which are displayed in the graphic above. The &lt;a href=&#34;https://github.com/rstudio/cheatsheets/raw/master/data-transformation.pdf&#34;&gt;&lt;em&gt;Data Transformation cheat sheet&lt;/em&gt;&lt;/a&gt; is a classic example of a straightforward mnemonic tool.
It is likely that even someone who just beginning to work with &lt;code&gt;dplyr&lt;/code&gt; will immediately grok that it organizes functions that manipulate tidy data. The cognitive load then is to remember how functions are grouped by task. The cheat sheet offers a canonical set of classes: &amp;ldquo;manipulate cases&amp;rdquo;, &amp;ldquo;manipulate variables&amp;rdquo; etc. to facilitate the process. Users that work with &lt;code&gt;dplyr&lt;/code&gt; on a regular basis will probably just need to glance at the cheat sheet after a relatively short time.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&#34;https://github.com/rstudio/cheatsheets/raw/master/shiny.pdf&#34;&gt;&lt;em&gt;Shiny cheat sheet&lt;/em&gt;&lt;/a&gt; is little more ambitious. It works on multiple levels and goes beyond categories to also suggest process and workflow.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;shiny.png&#34; height = &#34;400&#34; width=&#34;100%&#34;&gt;&lt;/p&gt;

&lt;p&gt;The &lt;a href=&#34;https://github.com/rstudio/cheatsheets/raw/master/purrr.pdf&#34;&gt;&lt;em&gt;Apply functions cheat sheet&lt;/em&gt;&lt;/a&gt; takes on an even more difficult task. For most of us, internally visualizing multi-level data structures is difficult enough, imaging how data elements flow under transformations is a serious cognitive load. I for one, really appreciate the help.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;purrr.png&#34; height = &#34;400&#34; width=&#34;100%&#34;&gt;&lt;/p&gt;

&lt;p&gt;Cheat sheets are immensely popular. And even in this ebook age where nearly everything you can look at is online, and conference attending digital natives travel light, the cheat sheets as artifacts retain considerable appeal. Not only are they useful tools and geek art (Take a look at &lt;a href=&#34;https://github.com/rstudio/cheatsheets/raw/master/cartography.pdf&#34;&gt;&lt;em&gt;cartography&lt;/em&gt;&lt;/a&gt;) for decorating a workplace, my guess is that they are perceived as &lt;em&gt;runes of power&lt;/em&gt; enabling the cognoscenti to grasp essential knowledge and project it in the world.&lt;/p&gt;

&lt;p&gt;When in-person conferences resume again, I fully expect the heavy paper copies to disappear soon after we put them out at the RStudio booth.&lt;/p&gt;

        &lt;script&gt;window.location.href=&#39;https://rviews.rstudio.com/2021/03/10/rstudio-open-source-resorurces/&#39;;&lt;/script&gt;
      </description>
    </item>
    
    <item>
      <title>Learn and Teach R</title>
      <link>https://rviews.rstudio.com/2020/12/02/learn-and-teach-r/</link>
      <pubDate>Wed, 02 Dec 2020 00:00:00 +0000</pubDate>
      
      <guid>https://rviews.rstudio.com/2020/12/02/learn-and-teach-r/</guid>
      <description>
        &lt;p&gt;If you haven&amp;rsquo;t explored the RStudio website in a while, your next visit may include a pleasant surprise. I recently went to the &lt;a href=&#34;https://education.rstudio.com/&#34;&gt;Tidymodels&lt;/a&gt; page, just to see what was new and was immediately drawn into the new landscape imagined by the RStudio education team. Clicking on &lt;a href=&#34;https://www.tidymodels.org/start/&#34;&gt;Get Started&lt;/a&gt; I came to a fork and a choice of &lt;a href=&#34;https://www.tidymodels.org/learn/&#34;&gt;going farther&lt;/a&gt; with Tidymodels or backing up a bit. I went down the beginners path &lt;a href=&#34;https://education.rstudio.com/learn/&#34;&gt;Finding Your Way to R&lt;/a&gt; and found myself in a well-lit wood, and I was not lost.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;forest.jpg&#34; height = &#34;400&#34; width=&#34;600&#34;&gt;&lt;/p&gt;

&lt;p&gt;Like a park with well-marked trails, the Learning R section of the RStudio Education site branches off to R excursions graded to match the &amp;ldquo;hikers&amp;rdquo; experience. The &lt;a href=&#34;img src=&amp;quot;mobility.png&amp;quot; height = &amp;quot;400&amp;quot; width=&amp;quot;600&amp;quot;&#34;&gt;Beginners&lt;/a&gt; trail starts in a safe place that should make even the absolutely terrified feel comfortable. It offers different modes of learning including videos, tutorials, books and even excursions to trusted third party sites that have their own feel.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&#34;https://education.rstudio.com/learn/intermediate/&#34;&gt;Intermediates&lt;/a&gt; section emphasizes learning how to get help, suggests some basic tools that should be useful no matter what path you select, and then points to places where you may already know you want to go: bioconductor, financial models or Spark clusters for example. The basic idea is that at this stage you know enough R to get some real work done, and a good path to making further progress might be to follow what interests you.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&#34;https://education.rstudio.com/learn/expert/&#34;&gt;Experts&lt;/a&gt; trail is for the intrepid who are ready to venture past terra firma and take a deep dive&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;dive.jpg&#34; height = &#34;400&#34; width=&#34;600&#34;&gt;&lt;/p&gt;

&lt;p&gt;into the foundations of R, or package building, or using Python, or exploring deep learning with Tensorflow. As with the others, this trail is well marked and offers tools and suggestions for making progress.&lt;/p&gt;

&lt;p&gt;Perhaps the most pleasant surprise for an educator coming to the RStudio Education site is to see that the trails don&amp;rsquo;t stop with Expert. There is an entire section of the &amp;ldquo;park&amp;rdquo; marked off for teaching with trails that offer essential material for supporting both educators and online education. &lt;a href=&#34;https://education.rstudio.com/teach/how-to-teach/&#34;&gt;Learn to teach&lt;/a&gt; offers advice on how to develop as a teacher based on practical experience with &lt;a href=&#34;https://carpentries.org/&#34;&gt;the Carpentries&lt;/a&gt;. The section on &lt;a href=&#34;https://education.rstudio.com/teach/materials/&#34;&gt;Materials for teaching&lt;/a&gt; offers a panpoply of courses and workshops developed at RStudio that teachers can freely adapt to their needs. There is material here relevant to data wrangling, data science, R, tidyverse, shiny and more. The third section, &lt;a href=&#34;https://education.rstudio.com/teach/tools/&#34;&gt;Tools for teaching&lt;/a&gt; describes RStudio Cloud and other RStudio tools for creating a modern, interactive teaching infrastructure.&lt;/p&gt;

&lt;p&gt;Whether you are just thinking about learning R or about to teach an advanced course, I think you might enjoy walking around the RStudio &lt;a href=&#34;https://education.rstudio.com/&#34;&gt;Education&lt;/a&gt; website. Maybe, I&amp;rsquo;ll get to Tidymodels next time.&lt;/p&gt;

        &lt;script&gt;window.location.href=&#39;https://rviews.rstudio.com/2020/12/02/learn-and-teach-r/&#39;;&lt;/script&gt;
      </description>
    </item>
    
    <item>
      <title>R for Enterprise: Understanding R’s Startup</title>
      <link>https://rviews.rstudio.com/2017/04/19/r-for-enterprise-understanding-r-s-startup/</link>
      <pubDate>Wed, 19 Apr 2017 00:00:00 +0000</pubDate>
      
      <guid>https://rviews.rstudio.com/2017/04/19/r-for-enterprise-understanding-r-s-startup/</guid>
      <description>
        
&lt;!-- BLOGDOWN-HEAD --&gt;
&lt;!-- /BLOGDOWN-HEAD --&gt;

&lt;!-- BLOGDOWN-BODY-BEFORE --&gt;
&lt;!-- /BLOGDOWN-BODY-BEFORE --&gt;
&lt;p&gt;R’s startup behavior is incredibly powerful. R sets environment variables, loads base packages, and understands whether you’re running a script, an interactive session, or even a build command.&lt;/p&gt;
&lt;p&gt;Most R users will never have to worry about changing R’s startup process. In fact, for portability and reproducibility of code, we recommend that users do not modify R’s startup profile. But, for system administrators, package developers, and R enthusiasts, customizing the launch process can provide a powerful tool and help avoid common gotchas. R’s behavior is thoroughly documented in &lt;a href=&#34;https://stat.ethz.ch/R-manual/R-devel/library/base/html/Startup.html&#34;&gt;R’s base documentation: “Initialization at Start of an R Session”&lt;/a&gt;. This post will elaborate on the official documentation and provide some examples. Read on if you’ve ever wondered how to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Tell R about a &lt;a href=&#34;https://rstudio.github.io/packrat/custom-repos.html&#34;&gt;local CRAN-like repository&lt;/a&gt; to host and share R packages internally&lt;/li&gt;
&lt;li&gt;Use a different version of Python, e.g., to support a &lt;a href=&#34;http://rstudio.github.io/tensorflow&#34;&gt;Tensorflow&lt;/a&gt; project&lt;/li&gt;
&lt;li&gt;Define a proxy so R can reach the internet in locked-down environments&lt;/li&gt;
&lt;li&gt;Understand why &lt;a href=&#34;https://rstudio.github.io/packrat/&#34;&gt;Packrat&lt;/a&gt; creates a .Rprofile&lt;/li&gt;
&lt;li&gt;Automatically run code at the end of a session to capture and log &lt;code&gt;sesssionInfo()&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We’ll also discuss how RStudio starts R. Spoiler: it’s a bit different than you might expect!&lt;/p&gt;
&lt;div id=&#34;rprofile-.renviron-and-r.site-oh-my&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;.Rprofile, .Renviron, and R*.site oh my!&lt;/h2&gt;
&lt;p&gt;R’s startup process follows three steps: starting R, setting environment variables, and sourcing profile scripts. In the last two steps, R looks for site-wide files and user- or project-specific files. The R documentation explains this process in detail.&lt;/p&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;/post/2017-04-04-rs-quirky-and-powerful-startup_files/R_STARTUP.jpeg&#34; /&gt;

&lt;/div&gt;
&lt;div id=&#34;common-gotchas-and-tricks&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Common Gotchas and Tricks:&lt;/h3&gt;
&lt;ol style=&#34;list-style-type: decimal&#34;&gt;
&lt;li&gt;&lt;p&gt;The Renviron file located at &lt;code&gt;R_HOME/etc&lt;/code&gt; is unique and different from Renviron.site and the user-specific .Renviron files. &lt;em&gt;Do not edit the Renviron file!&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A site-wide file, and either a project file &lt;em&gt;or&lt;/em&gt; a user file, can be loaded at the same time. It is not possible to use both a user file and a project file. If the project file exists, it will be used instead of the user file.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The environment files are plain-text files in the form &lt;code&gt;name=value&lt;/code&gt;. The profile files contain R code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To double check what environment variables are defined in the R environment, run &lt;code&gt;Sys.getenv()&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Do not place things in a profile that limit the reproducibility or portability of your code. For example, setting &lt;code&gt;options(stringsAsFactors = FALSE)&lt;/code&gt; is discouraged because it will cause your code to break in mysterious ways in other environments. Other bad ideas include: reading in data, loading packages, and defining functions.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;div id=&#34;where-to-put-what&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Where to put what?&lt;/h3&gt;
&lt;p&gt;The R Startup process is very flexible, which means there are different ways to achieve the same results. For example, you may be wondering which environment variables to set in .Renviron versus Renviron.site. (Don’t even think about calling &lt;code&gt;Sys.setenv()&lt;/code&gt; in a Rprofile…)&lt;/p&gt;
&lt;p&gt;A simple rule of thumb is to answer the question: “When else do I want this variable to be set?”&lt;/p&gt;
&lt;p&gt;For example, if you’re on a shared server and you want the settings every time you run R, place .Renviron or .Rprofile in your home directory. If you’re a system admin and you want the settings to take affect for every user, modify Renviron.site or Rprofile.site.&lt;/p&gt;
&lt;p&gt;The best practice is to scope these settings as narrowly as possible. That means if you can place code in .Rprofile instead of Rprofile.site you should! This practice complements the previous warnings about modifying R’s startup. The narrowest scope is to setup the environment within the code, not the profile.&lt;/p&gt;
&lt;div id=&#34;quiz&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;Quiz&lt;/h4&gt;
&lt;p&gt;What is the best way to modify the path? The answer depends on the desired scope for the change.&lt;/p&gt;
&lt;p&gt;For example, in an R project using the &lt;a href=&#34;http://rstudio.github.io/tensorflow&#34;&gt;Tensorflow&lt;/a&gt; package, I might want R to use the version of Python installed in &lt;code&gt;/usr/local/bin&lt;/code&gt; instead of &lt;code&gt;/usr/bin&lt;/code&gt;. This change is best implemented by reordering the &lt;code&gt;PATH&lt;/code&gt; using &lt;code&gt;PATH=/usr/local/bin:${PATH}&lt;/code&gt;. This is a change I only want for this project, so I’d place the line in a .Renviron file in the project directory.&lt;/p&gt;
&lt;p&gt;On the other hand, I may want to add the JAVA SDK to the path so that any R session can use the &lt;code&gt;rJava&lt;/code&gt; package. To do so, I’d add a line like &lt;code&gt;PATH=${PATH}:/opt/jdk1.7.0_75/bin:/opt/jdk1.7.0_75/jre/bin&lt;/code&gt; to Renviron.site.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;r-startup-in-rstudio&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;R Startup in RStudio&lt;/h2&gt;
&lt;p&gt;A common misconception is that R and RStudio are one in the same. RStudio runs on top of R and requires R to be installed separately. If you look at the process list while running RStudio, you’ll see at least two different processes: usually one called RStudio and one called rsession.&lt;/p&gt;
&lt;p&gt;RStudio starts R a bit differently than running R from the terminal. Technically, RStudio doesn’t “start” R, it uses R as a library, either as a DLL on Windows or as a shared object on Mac and Linux.&lt;/p&gt;
&lt;p&gt;The main difference is that the script wrapped around R’s binary is not run, and any customization to the script will not take affect. To see the script try:&lt;/p&gt;
&lt;pre class=&#34;bash&#34;&gt;&lt;code&gt;cat $(which R)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For most people, this difference won’t be noticeable. Any settings in the startup files will still take affect. For user’s that build R from source, it is important to include the &lt;code&gt;--enable-R-shlib&lt;/code&gt; flag to ensure R also builds the shared libraries used by RStudio.&lt;/p&gt;
&lt;div id=&#34;r-startup-in-rstudio-server-pro&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;R Startup in RStudio Server Pro&lt;/h3&gt;
&lt;p&gt;RStudio Server Pro acts differently from R and the open-source version of RStudio. Prior to starting R, RStudio Server Pro uses PAM to create a session, and sources the &lt;code&gt;rsession-profile&lt;/code&gt;. In addition, RStudio Server Pro launches R from bash, which means settings defined in the user’s bash profile are available.&lt;/p&gt;
&lt;p&gt;In short, RStudio Server Pro provides more ways to customize the environment used by R. You might ask why you’d ever want &lt;em&gt;more&lt;/em&gt; options. Recall our rule of thumb: “When else do I want this variable to be set?”&lt;/p&gt;
&lt;p&gt;In server environments, there are often environment variables set every time a user interacts with the server. These environment variables are placed in a user’s bash profile by a system admin. Normally R wouldn’t pick up these settings. RStudio Server Pro allows R to make use of the work the system admin has already done by picking up these profiles.&lt;/p&gt;
&lt;p&gt;Likewise, there may be some actions that take place on the server when a user logs in that have to happen before R starts. For example, a Kerberos ticket used by the R session to access a data source must exist before R is started. RStudio Server Pro uses PAM sessions to enable these actions.&lt;/p&gt;
&lt;p&gt;There may also be actions or variables that should only be defined for RStudio, and not any other time R is run. To facilitate this use case, RStudio Server Pro provides the &lt;code&gt;rsession-profile&lt;/code&gt;. For example, if your environment makes use of RStudio Server Pro’s support for multiple versions of R, you’d place any environment variables that should defined for all versions of R inside of &lt;code&gt;rsession-profile&lt;/code&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;examples&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Examples:&lt;/h2&gt;
&lt;div id=&#34;define-proxy-settings-in-renviron.site&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Define proxy settings in Renviron.site&lt;/h3&gt;
&lt;p&gt;Renviron.site is commonly used to tell R how to access the internet in environments with restricted network access. Renviron.site is used so the settings take affect for all R sessions and users. For example,&lt;/p&gt;
&lt;pre class=&#34;bash&#34;&gt;&lt;code&gt;http_proxy=http://proxy.mycompany.com&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This article contains more details on how to &lt;a href=&#34;https://support.rstudio.com/hc/en-us/articles/200488488-Configuring-R-to-Use-an-HTTP-or-HTTPS-Proxy&#34;&gt;configure RStudio to use a proxy&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;add-a-local-cran-repository-for-all-users&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Add a local CRAN repository for all users&lt;/h3&gt;
&lt;p&gt;Organizations with offline environments often use local CRAN repositories instead of installing packages directly from a CRAN mirror. Local CRAN repositories are also useful for sharing internally developed R packages among colleagues.&lt;/p&gt;
&lt;p&gt;To use a local CRAN repository, it is necessary to add the repository to R’s list of repos. This setting is important for all sessions and users, so &lt;code&gt;Rprofile.site&lt;/code&gt; is used.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;old_repos &amp;lt;- getOption(&amp;quot;repos&amp;quot;)
local_CRAN_URI &amp;lt;- paste0(&amp;quot;file://&amp;quot;, normalizePath(&amp;quot;path_to_local_CRAN_repo&amp;quot;))
options(repos = c(old_repos, my_repo = lcoal_CRAN_URI))&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;More information on setting up a local CRAN repository is available &lt;a href=&#34;https://rstudio.github.io/packrat/custom-repos.html&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;record-sessioninfo-automatically&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Record sessionInfo automatically&lt;/h3&gt;
&lt;p&gt;Reproducibility is a critical part of any analysis done in R. One challenge for reproducible scripts and documents is tracking the version of R packages used during an analysis.&lt;/p&gt;
&lt;p&gt;The following code can be added to a .Rprofile file within an RStudio project to automatically log the &lt;code&gt;sessionInfo()&lt;/code&gt; after every RStudio session.&lt;/p&gt;
&lt;p&gt;This log could be referenced if an analysis needs to be run at a later date and fails due to a package discrepancy.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;.Last &amp;lt;- function(){
  if (interactive()) {
    
    ## check to see if we&amp;#39;re in an RStudio project (requires the rstudioapi package)
    if (!requireNamespace(&amp;quot;rstudioapi&amp;quot;))
      return(NULL)
    pth &amp;lt;- rstudioapi::getActiveProject()
    if (is.null(pth))
      return(NULL)
    
    ## append date + sessionInfo to a file called sessionInfoLog
    cat(&amp;quot;Recording session info into the project&amp;#39;s sesionInfoLog file...&amp;quot;)
    info &amp;lt;-  capture.output(sessionInfo())
    info &amp;lt;- paste(&amp;quot;\n----------------------------------------------&amp;quot;,
                  paste0(&amp;#39;Session Info for &amp;#39;, Sys.time()),
                  paste(info, collapse = &amp;quot;\n&amp;quot;),
                  sep  = &amp;quot;\n&amp;quot;)
    f &amp;lt;- file.path(pth, &amp;quot;sessionInfoLog&amp;quot;)
    cat(info, file = f, append = TRUE)
  }
}&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;automatically-turn-on-packrat&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Automatically turn on packrat&lt;/h3&gt;
&lt;p&gt;&lt;a href=&#34;http://rstudio.github.io/packrat&#34;&gt;Packrat&lt;/a&gt; is an automated tool for package management and reproducible research. Packrat acts as a super-set of the previous example. When a user opts in to using packrat with an RStudio project, one of the things packrat automatically does is create (or modify) a project-specific .Rprofile. Packrat uses the .Rprofile to ensure that each time the project opens, Packrat mode is turned on.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;to-wrap-up&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;To Wrap Up&lt;/h2&gt;
&lt;p&gt;R’s startup behavior can be complex, sometimes quirky, but always powerful. At RStudio, we’ve worked hard to ensure that R starts and stops correctly whether you’re running RStudio Desktop, serving a Shiny app on shinyapps.io, rendering a report in RStudio Connect, or supporting hundreds of users and thousands of sessions in a load balanced configuration of RStudio Server Pro.&lt;/p&gt;
&lt;/div&gt;

        &lt;script&gt;window.location.href=&#39;https://rviews.rstudio.com/2017/04/19/r-for-enterprise-understanding-r-s-startup/&#39;;&lt;/script&gt;
      </description>
    </item>
    
    <item>
      <title>March &#39;17 Tips and Tricks</title>
      <link>https://rviews.rstudio.com/2017/03/31/march-17-tips-and-tricks/</link>
      <pubDate>Fri, 31 Mar 2017 00:00:00 +0000</pubDate>
      
      <guid>https://rviews.rstudio.com/2017/03/31/march-17-tips-and-tricks/</guid>
      <description>
        


&lt;p&gt;This month’s Tips and Tricks focus is on file navigation. Many of these tips are straightforward - more tip than trick - but they can save quite a bit of time and frustration.&lt;/p&gt;
&lt;div id=&#34;open-recent&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Open Recent&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;Please&lt;/em&gt; don’t spend time navigating through your folder structure to find a recent project or file.&lt;/p&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;/post/2017-03-24-march-17-tips-and-tricks_files/recent_files_projs.png&#34; /&gt;

&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;go-to-filefunction&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Go to File/Function&lt;/h3&gt;
&lt;p&gt;RStudio automatically indexes all open files as well as files in the current project. The index includes function calls and objects within the files. To search the index, enter a search string in the &lt;code&gt;Go to file/function&lt;/code&gt; window in the main toolbar or use the keyboard shortcut &lt;code&gt;Ctrl + .&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The search supports fuzzy matching as long as the search string is in the correct order. For example, &lt;code&gt;tiptric&lt;/code&gt; will match files and function names like &lt;code&gt;march-tips-and-tricks.Rmd&lt;/code&gt;.&lt;/p&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;/post/2017-03-24-march-17-tips-and-tricks_files/go_to_file.png&#34; /&gt;

&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;find-in-file&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Find in File&lt;/h3&gt;
&lt;p&gt;In addition to the index, RStudio can quickly search the text of any file(s) for a string or regular expression. Open the &lt;code&gt;Find in Files&lt;/code&gt; dialogue by navigating through the toolbar &lt;code&gt;Edit -&amp;gt; Find in Files&lt;/code&gt; or using the keyboard shortcut &lt;code&gt;Cmd / Ctrl + Shift + F&lt;/code&gt;.&lt;/p&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;/post/2017-03-24-march-17-tips-and-tricks_files/find-in-files.gif&#34; /&gt;

&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;tabs&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Tabs&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Close All and Close All Except Current&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you’re like me, you often end up with a whole bunch of files open and the number of tabs in the source pane causes anxiety. Don’t click through the tabs closing each individually.&lt;/p&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;/post/2017-03-24-march-17-tips-and-tricks_files/close_tab.png&#34; /&gt;

&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Search for a Tab&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you don’t get anxiety from multiple tabs, you may find the keyboard shortcuts for switching between tabs helpful. My favorite is &lt;code&gt;Ctrl + Shift + .&lt;/code&gt; which opens a search dialogue for the currently open tabs.&lt;/p&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;/post/2017-03-24-march-17-tips-and-tricks_files/tabs.png&#34; /&gt;

&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;set-working-directory&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Set Working Directory&lt;/h3&gt;
&lt;p&gt;Sometimes I find myself inside a file and I have no idea where that file is. In this scenario, I often use the following trick to orient myself:&lt;/p&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;/post/2017-03-24-march-17-tips-and-tricks_files/session_workingdir.png&#34; /&gt;

&lt;/div&gt;
&lt;p&gt;The other options, &lt;code&gt;To Project Directory&lt;/code&gt; and &lt;code&gt;To File Pane Location&lt;/code&gt; are also very helpful. These commands do not have key bindings by default, but you can create your own keyboard shortcuts for these actions: &lt;code&gt;Tools -&amp;gt; Modify Keyboard Shortcuts...&lt;/code&gt;&lt;/p&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;/post/2017-03-24-march-17-tips-and-tricks_files/keyboard_shortcuts.png&#34; /&gt;

&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;file-pane-go-to-working-directory&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;File Pane: Go To Working Directory&lt;/h3&gt;
&lt;p&gt;After mastering tip 5, you can easily navigate from the file pane to the working directory:&lt;/p&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;/post/2017-03-24-march-17-tips-and-tricks_files/goto_wd.png&#34; /&gt;

&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;file-pane-go-to-project-root-directory&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;File Pane: Go To Project Root Directory&lt;/h3&gt;
&lt;p&gt;Finally, it is really easy to go to the root of a project directory:&lt;/p&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;/post/2017-03-24-march-17-tips-and-tricks_files/goto_proj.png&#34; /&gt;

&lt;/div&gt;
&lt;p&gt;Be sure to follow &lt;a href=&#34;https://twitter.com/rstudiotips&#34;&gt;@rstudiotips&lt;/a&gt; for more frequent updates. Tweet us &lt;a href=&#34;https://twitter.com/rstudio&#34;&gt;@rstudio&lt;/a&gt; if there’s a file navigation trick you wish we’d implement!&lt;/p&gt;
&lt;/div&gt;

        &lt;script&gt;window.location.href=&#39;https://rviews.rstudio.com/2017/03/31/march-17-tips-and-tricks/&#39;;&lt;/script&gt;
      </description>
    </item>
    
    <item>
      <title>February &#39;17 Tips and Tricks</title>
      <link>https://rviews.rstudio.com/2017/03/03/february-17-tips-and-tricks/</link>
      <pubDate>Fri, 03 Mar 2017 00:00:00 +0000</pubDate>
      
      <guid>https://rviews.rstudio.com/2017/03/03/february-17-tips-and-tricks/</guid>
      <description>
        

&lt;p&gt;If you spend time with an excellent programmer, one thing that immediately jumps out is how quickly she can write code. It often appears to be magic, the number of keystrokes simply can&amp;rsquo;t equal the number of characters on the screen. The secret: it doesn&amp;rsquo;t! Most programmers use a series of tricks to save the hassle of writing boilerplate code. This month, my personal goal was to spend less time typing, even if it required slowing down to master these tricks. In this post, I&amp;rsquo;ll focus on one of the easiest and most flexible tools at your disposal: &lt;a href=&#34;https://support.rstudio.com/hc/en-us/articles/204463668-Code-Snippets&#34;&gt;code snippets&lt;/a&gt;. (Astute readers will note that I&amp;rsquo;ve mentioned code snippets &lt;a href=&#34;https://www.rstudio.com/rviews/2016/11/11/easy-tricks-you-mightve-missed/&#34;&gt;before&lt;/a&gt;. They deserve the extra attention!)&lt;/p&gt;

&lt;p&gt;Code snippets are a common programming tool similar to keyboard shortcuts. A snippet of text, usually a few characters long, is used as a shortcut to create a larger piece of boilerplate code. &lt;code&gt;Tab&lt;/code&gt; navigation enables jumping through the boilerplate code to locations where customization is required.&lt;/p&gt;

&lt;p&gt;For example, one of my favorite code snippets is for creating a function. The template of an R function looks like:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;functionName &amp;lt;- function(arguments) {
  code 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The boilerplate - not worth typing - is:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; &amp;lt;- function( ) {
 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;In RStudio, the code snippet for functions is &lt;code&gt;fun&lt;/code&gt;. Typing &lt;code&gt;fun&lt;/code&gt; and pressing &lt;code&gt;Tab&lt;/code&gt; will provide an auto-complete suggestion for the snippet. Typing &lt;code&gt;fun&lt;/code&gt; and pressing &lt;code&gt;Shift + Tab&lt;/code&gt; inserts the snippet directly. As a general typing rule, keeping your hands on the middle row of the keyboard will speed things up. I hit &lt;code&gt;Shift&lt;/code&gt; with my right pinky and &lt;code&gt;Tab&lt;/code&gt; with my left.&lt;/p&gt;

&lt;p&gt;After inserting the boilerplate code, the cursor is placed to left of the &lt;code&gt;&amp;lt;-&lt;/code&gt;. You can then quickly type the name of the function. Pressing &lt;code&gt;Tab&lt;/code&gt; places the cursor in between the parenthesis. Pressing &lt;code&gt;Tab&lt;/code&gt; again places the cursor in between the brackets. This allows you to fill in the remaining portions of the function template quickly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Type &lt;code&gt;fun&lt;/code&gt; and &lt;code&gt;Shift + Tab&lt;/code&gt;:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;HERE &amp;lt;- function() {

}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Pressing &lt;code&gt;Tab&lt;/code&gt; Once&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; &amp;lt;- function(HERE) {
 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Pressing &lt;code&gt;Tab&lt;/code&gt; Twice&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; &amp;lt;- function() {
 HERE
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&#34;accessing-snippets&#34;&gt;Accessing Snippets&lt;/h2&gt;

&lt;p&gt;RStudio comes with many built-in snippets. To access these snippets, navigate to &lt;code&gt;Tools&lt;/code&gt; -&amp;gt; &lt;code&gt;Global Options&lt;/code&gt; -&amp;gt; &lt;code&gt;Code&lt;/code&gt; and press &lt;code&gt;Edit Snippets&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/post/2017-02-16-feb-17-tips-and-tricks_files/SL_code_snippets.png&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;

&lt;p&gt;The menu will show all of the defined snippets. Consider the definition for the function snippet:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;snippet fun
	${1:name} &amp;lt;- function(${2:variables}) {
		${0}
	}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The snippet starts by defining the character shortcut &lt;code&gt;fun&lt;/code&gt;. The definition includes the boilerplate code. The &lt;code&gt;Tab&lt;/code&gt; behavior is defined using &lt;code&gt;${1}&lt;/code&gt; notation. The &lt;a href=&#34;https://support.rstudio.com/hc/en-us/articles/204463668-Code-Snippets&#34;&gt;code snippet&lt;/a&gt; help page describes the syntax in more detail.&lt;/p&gt;

&lt;h2 id=&#34;a-few-examples&#34;&gt;A Few Examples&lt;/h2&gt;

&lt;h3 id=&#34;ts&#34;&gt;&lt;code&gt;ts&lt;/code&gt;&lt;/h3&gt;

&lt;p&gt;Adds a time-stamped comment.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# Mon Feb 20 07:34:03 2017 ------------------------------
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&#34;if&#34;&gt;&lt;code&gt;if&lt;/code&gt;&lt;/h3&gt;

&lt;p&gt;Adds the skeleton of an &lt;code&gt;if&lt;/code&gt; statement&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;if () {

}
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&#34;mat&#34;&gt;&lt;code&gt;mat&lt;/code&gt;&lt;/h3&gt;

&lt;p&gt;Adds the skeleton for defining a matrix.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;matrix( , nrow = , ncol = )
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;There are code snippets for other languages as well.&lt;/p&gt;

&lt;h2 id=&#34;creating-snippets&#34;&gt;Creating Snippets&lt;/h2&gt;

&lt;p&gt;Code snippets are powerful because they can be customized and created. If you find yourself repeatedly typing the same code, create a snippet. The menu of snippets in RStudio is editable. To create or modify a snippet, add your changes to the menu and click &lt;code&gt;Save&lt;/code&gt;.&lt;/p&gt;

&lt;h2 id=&#34;sharing-snippets&#34;&gt;Sharing Snippets&lt;/h2&gt;

&lt;p&gt;Once you&amp;rsquo;ve created a handful of useful code snippets, it would be generous to share. The &lt;a href=&#34;https://github.com/dgrtwo/snippr&#34;&gt;&lt;code&gt;snippr&lt;/code&gt; package&lt;/a&gt; makes this process easy.&lt;/p&gt;

&lt;p&gt;This &lt;a href=&#34;https://gist.github.com/slopp/27903daaf9fbd41afc73442b600a7618&#34;&gt;gist&lt;/a&gt; contains two of my favorites: a code snippet for creating a single file Shiny app, and a code snippet to start a ggplot.&lt;/p&gt;

&lt;p&gt;Shiny:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;snippet shiny
	library(shiny)
	ui &amp;lt;- fluidPage(
		${1:ui}
	)
	
	server &amp;lt;- function(input, output, session){
	  ${2:server}
	}
	shinyApp(ui = ui, server = server)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;ggplot2:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;snippet gg
	ggplot(${1:data}, aes(${2:aes})) + 
	  geom_${3:geom}()
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;What are your favorite snippets?&lt;/p&gt;

        &lt;script&gt;window.location.href=&#39;https://rviews.rstudio.com/2017/03/03/february-17-tips-and-tricks/&#39;;&lt;/script&gt;
      </description>
    </item>
    
    <item>
      <title>January &#39;17 Tips and Tricks</title>
      <link>https://rviews.rstudio.com/2017/01/27/january-17-rstudio-tips-and-tricks/</link>
      <pubDate>Fri, 27 Jan 2017 00:00:00 +0000</pubDate>
      
      <guid>https://rviews.rstudio.com/2017/01/27/january-17-rstudio-tips-and-tricks/</guid>
      <description>
        &lt;p&gt;This month&amp;rsquo;s collection of Tips and Tricks comes from an excellent talk given at the 2017 RStudio::Conf in Orlando by RStudio Software Engineer Kevin Ushey.  The slides from his talk are embedded below and cover features from autocompletion to R Markdown shortcuts. Use the left and right arrow keys to change slides.&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;

&lt;iframe src=&#34;https://rawgit.com/kevinushey/2017-rstudio-conf/master/slides.html#1&#34; width=&#34;100%&#34; height=&#34;600&#34; frameborder=&#34;0&#34; marginwidth=&#34;0&#34; marginheight=&#34;0&#34; scrolling=&#34;no&#34; style=&#34;border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;&#34; allowfullscreen=&#34;&#34;&gt;&lt;/iframe&gt;

        &lt;script&gt;window.location.href=&#39;https://rviews.rstudio.com/2017/01/27/january-17-rstudio-tips-and-tricks/&#39;;&lt;/script&gt;
      </description>
    </item>
    
    <item>
      <title>December &#39;16 RStudio Tips and Tricks</title>
      <link>https://rviews.rstudio.com/2016/12/09/december-16-rstudio-tips-and-tricks/</link>
      <pubDate>Fri, 09 Dec 2016 00:00:00 +0000</pubDate>
      
      <guid>https://rviews.rstudio.com/2016/12/09/december-16-rstudio-tips-and-tricks/</guid>
      <description>
        

&lt;p&gt;Here is this month&amp;rsquo;s collection of RStudio Tips and Tricks. Thank you to those who responded to &lt;a href=&#34;https://www.rstudio.com/rviews/2016/11/11/easy-tricks-you-mightve-missed/&#34;&gt;last month&amp;rsquo;s post&lt;/a&gt;; many of your tips are included below! Be sure to subscribe to &lt;a href=&#34;https://twitter.com/rstudiotips&#34;&gt;@rstudiotips&lt;/a&gt; on Twitter for more.&lt;/p&gt;

&lt;p&gt;This month&amp;rsquo;s tips fall into two categories: Keyboard Shortcuts and Easier R Markdown.&lt;/p&gt;

&lt;h1 id=&#34;keyboard-shortcuts&#34;&gt;Keyboard Shortcuts&lt;/h1&gt;

&lt;p&gt;The RStudio IDE is built upon &amp;ldquo;hooks&amp;rdquo;. Hooks are actions that the IDE can take. For instance, there is a hook to create a new file. Most users interact with hooks with point-and-click interactions. (&lt;code&gt;RStudio toolbar -&amp;gt; new file&lt;/code&gt; or &lt;code&gt;File -&amp;gt; New File&lt;/code&gt;). But, there is an alternative! All of these hooks have been surfaced to end users and can be bound to a keyboard shortcut. (Some of these actions are &amp;ldquo;secret&amp;rdquo; - they aren&amp;rsquo;t exposed through point-and-click options.)&lt;/p&gt;

&lt;h2 id=&#34;custom-keyboard-shortcuts&#34;&gt;Custom Keyboard Shortcuts&lt;/h2&gt;

&lt;p&gt;To view the complete list of actions, the current keybindings, and to customize keybindings, go to: &lt;code&gt;Tools -&amp;gt; Modify Keyboard Shortcuts&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://www.rstudio.com/wp-content/uploads/2016/12/tips_keyboard_shortcuts.gif&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;

&lt;h2 id=&#34;code-chunk-navigation&#34;&gt;Code Chunk Navigation&lt;/h2&gt;

&lt;p&gt;Define shortcuts for code chunk navigation using the previous tip. For example, &lt;code&gt;Alt+Cmd+Down&lt;/code&gt; for Next Chunk and &lt;code&gt;Alt+Cmd+Up&lt;/code&gt; for Previous Chunk.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://www.rstudio.com/wp-content/uploads/2016/12/tips_codechunknav.gif&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;

&lt;h2 id=&#34;assignment-operator&#34;&gt;Assignment Operator&lt;/h2&gt;

&lt;p&gt;Use &lt;code&gt;Alt+-&lt;/code&gt; (press &lt;code&gt;Alt&lt;/code&gt; at the same time as pressing &lt;code&gt;-&lt;/code&gt;). This adds the assignment operator and spacing.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://www.rstudio.com/wp-content/uploads/2016/12/tips_assignNEW.gif&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;

&lt;h2 id=&#34;pipe-operator&#34;&gt;Pipe Operator&lt;/h2&gt;

&lt;p&gt;Use &lt;code&gt;Cmd+Shift+m&lt;/code&gt; (for Mac) or &lt;code&gt;Ctrl+Shift+m&lt;/code&gt; (for Windows). This adds the pipe operator &lt;code&gt;%&amp;gt;%&lt;/code&gt; and spacing.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://www.rstudio.com/wp-content/uploads/2016/12/tips_pipeNEW.gif&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;

&lt;h1 id=&#34;easier-r-markdown&#34;&gt;Easier R Markdown&lt;/h1&gt;

&lt;h2 id=&#34;r-markdown-options&#34;&gt;R Markdown Options&lt;/h2&gt;

&lt;p&gt;R Markdown output formats include arguments specified in the YAML header. Don&amp;rsquo;t worry about remembering all of the key-value pairs; in RStudio, you can access and change the most common through a user-interface.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://www.rstudio.com/wp-content/uploads/2016/12/tips_rmdoptions.gif&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;

&lt;h2 id=&#34;spell-checker&#34;&gt;Spell Checker&lt;/h2&gt;

&lt;p&gt;Use the built-in spell checker when writing a R Markdown document. (Code chunks are automatically ignored.)&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://www.rstudio.com/wp-content/uploads/2016/12/tips_spellcheck.gif&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;

&lt;h2 id=&#34;sql-code-chunks&#34;&gt;SQL Code Chunks&lt;/h2&gt;

&lt;p&gt;Execute SQL queries against database connections directly in R Markdown chunks.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://www.rstudio.com/wp-content/uploads/2016/12/tips_sql.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;

&lt;h2 id=&#34;r-markdown-websites&#34;&gt;R Markdown Websites&lt;/h2&gt;

&lt;p&gt;Are you building a &lt;a href=&#34;http://rmarkdown.rstudio.com/rmarkdown_websites.html&#34;&gt;website with R Markdown&lt;/a&gt;? Any RStudio project with an R Markdown website will include a Build Website option in the build pane.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://www.rstudio.com/wp-content/uploads/2016/12/tips_buildpane.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;

&lt;p&gt;What&amp;rsquo;s your favorite RStudio Tip?&lt;/p&gt;

        &lt;script&gt;window.location.href=&#39;https://rviews.rstudio.com/2016/12/09/december-16-rstudio-tips-and-tricks/&#39;;&lt;/script&gt;
      </description>
    </item>
    
    <item>
      <title>RStudio IDE Easy Tricks You Might&#39;ve Missed</title>
      <link>https://rviews.rstudio.com/2016/11/11/easy-tricks-you-mightve-missed/</link>
      <pubDate>Fri, 11 Nov 2016 00:00:00 +0000</pubDate>
      
      <guid>https://rviews.rstudio.com/2016/11/11/easy-tricks-you-mightve-missed/</guid>
      <description>
        

&lt;p&gt;The RStudio IDE reached version 1.0 this month. The IDE has come a long way since the initial release 5 and a half years ago. Many major features have been built: projects, package building tools, notebooks. During that same period, often hidden in the shadows, a growing list of smaller features has been changing lives. In celebration of version 1.0 this post hopes to spread fanfare for a few of these easy-to-miss tools.&lt;/p&gt;

&lt;h2 id=&#34;tearable-panes&#34;&gt;Tearable Panes&lt;/h2&gt;

&lt;p&gt;Tearable panes are anything but terrible. This feature allows users to tear off data view panes and source panes facilitating the use of multiple screens.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://www.rstudio.com/wp-content/uploads/2016/11/tip_tearable.gif&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://www.rstudio.com/wp-content/uploads/2016/11/image04.png&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;

&lt;h2 id=&#34;command-history&#34;&gt;Command History&lt;/h2&gt;

&lt;p&gt;In the console it is possible to scroll through the command history by clicking &lt;code&gt;Ctrl/Cmd&lt;/code&gt; and &lt;code&gt;↑&lt;/code&gt;. The command history will be filtered as code is typed into the console:&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://www.rstudio.com/wp-content/uploads/2016/11/tip_console.gif&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;

&lt;h2 id=&#34;history-pane&#34;&gt;History Pane&lt;/h2&gt;

&lt;p&gt;The history pane shows a searchable list of commands that have been run. Commands can be written to the source pane or the console. No more copy and paste from the console to a script!&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://www.rstudio.com/wp-content/uploads/2016/11/tip_history.gif&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;

&lt;h2 id=&#34;rename-in-scope&#34;&gt;Rename in Scope&lt;/h2&gt;

&lt;p&gt;This feature makes it easy to rename all instances of a variable. The tool is context aware; changing &amp;rsquo;m&amp;rsquo; to &amp;lsquo;m1&amp;rsquo; won&amp;rsquo;t change &amp;lsquo;mtcars&amp;rsquo; to &amp;lsquo;m1tcars&amp;rsquo;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://www.rstudio.com/wp-content/uploads/2016/11/tip_rename_in_scope.gif&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;

&lt;h2 id=&#34;gallery-and-satellite-view-in-notebooks&#34;&gt;Gallery and Satellite View in Notebooks&lt;/h2&gt;

&lt;p&gt;A new feature built into R Notebooks, a code chunk that produces multiple plots will produce a gallery. The plots can be viewed by toggling between thumbnails. The gallery can be expanded into a new satellite window for closer inspection.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://www.rstudio.com/wp-content/uploads/2016/11/tip_gallery_satellite.gif&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;

&lt;h2 id=&#34;code-outline&#34;&gt;Code Outline&lt;/h2&gt;

&lt;p&gt;Save time scrolling with the code outline. This feature works for R Notebooks and traditional R scripts. In R Notebooks sections are delimited by the R Markdown headers. In R scripts sections are delimited by section comments (Try Code -&amp;gt; Insert Section).&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://www.rstudio.com/wp-content/uploads/2016/11/tip_outline.gif&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;

&lt;h2 id=&#34;code-snippets&#34;&gt;Code Snippets&lt;/h2&gt;

&lt;p&gt;Code snippets are a shortcut to insert common boilerplate code. For instance, type fun and then Tab to insert the skeleton code for a function definition. Then hit Tab to replace the necessary components. In addition to a rich set of defaults, custom code snippets can also be created. &lt;a href=&#34;https://support.rstudio.com/hc/en-us/articles/204463668-Code-Snippets&#34;&gt;Learn more&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://www.rstudio.com/wp-content/uploads/2016/11/tip_code_snippet.gif&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;

&lt;h2 id=&#34;file-navigation&#34;&gt;File Navigation&lt;/h2&gt;

&lt;p&gt;Many people know of RStudio&amp;rsquo;s rich set of tab complete options for functions and function arguments. Tab complete can also help find files and remove the hassle of writing out long path locations. Hit tab in between two double quotes (&amp;rdquo; &amp;ldquo;) to open a file explorer.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://www.rstudio.com/wp-content/uploads/2016/11/tip_file_nav.gif&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;

&lt;h2 id=&#34;jump-to-function-definition&#34;&gt;Jump To Function Definition&lt;/h2&gt;

&lt;p&gt;Want to dig into the innards of a function? With the cursor on a function press &lt;code&gt;F2&lt;/code&gt; to jump to the function definition, even for functions in a package.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://www.rstudio.com/wp-content/uploads/2016/11/tip_goto_func.gif&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;

&lt;p&gt;These are just a few of my favorite tricks. A comprehensive list is available in the &lt;a href=&#34;https://www.rstudio.com/wp-content/uploads/2016/01/rstudio-IDE-cheatsheet.pdf&#34;&gt;RStudio IDE Cheatsheet&lt;/a&gt; or follow &lt;a href=&#34;https://twitter.com/rstudiotips&#34;&gt;@rstudiotips&lt;/a&gt; on Twitter to learn a few tricks every week.&lt;/p&gt;

&lt;p&gt;What&amp;rsquo;s your favorite RStudio tip?&lt;/p&gt;

        &lt;script&gt;window.location.href=&#39;https://rviews.rstudio.com/2016/11/11/easy-tricks-you-mightve-missed/&#39;;&lt;/script&gt;
      </description>
    </item>
    
  </channel>
</rss>
