<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/december-16-rstudio-tips-and-tricks/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://www.rstudio.com/rviews/2016/12/09/december-16-rstudio-tips-and-tricks/"> RStudio</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>

<p>by Sean Lopp</p>
<p>Here is this month’s collection of RStudio Tips and Tricks. Thank you to those who responded to <a target="_blank" rel="nofollow" href="https://www.rstudio.com/rviews/2016/11/11/easy-tricks-you-mightve-missed/">last month’s post</a>; many of your tips are included below! Be sure to subscribe to <span>@rstudiotips</span> on Twitter for more.</p>
<p>This month’s tips fall into two categories: Keyboard Shortcuts and Easier R Markdown</p>
<h1>Keyboard Shortcuts</h1>
<p>The RStudio IDE is built upon “hooks”. 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. (<code>RStudio toolbar -> new file</code> or <code>File -> New File</code>). 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 “secret” – they aren’t exposed through point-and-click options.)</p>
<h2>Custom Keyboard Shortcuts</h2>
<p>To view the complete list of actions, the current keybindings, and to customize keybindings, go to: <code>Tools -> Modify Keyboard Shortcuts</code>.</p>
<p><img src="https://i0.wp.com/www.rstudio.com/wp-content/uploads/2016/12/tips_keyboard_shortcuts.gif?w=456" data-recalc-dims="1"></p>
<h2>Code Chunk Navigation</h2>
<p>Define shortcuts for code chunk navigation using the previous tip. For example, <code>Alt+Cmd+Down</code> for Next Chunk and <code>Alt+Cmd+Up</code> for Previous Chunk.</p>
<p><img src="https://i2.wp.com/www.rstudio.com/wp-content/uploads/2016/12/tips_codechunknav.gif?w=456" data-recalc-dims="1"></p>
<h2>Assignment Operator</h2>
<p>Use <code>Alt+-</code> (press <code>Alt</code> at the same time as pressing <code>-</code>). This adds the assignment operator and spacing.</p>
<p><img src="https://i2.wp.com/www.rstudio.com/wp-content/uploads/2016/12/tips_assignNEW.gif?w=456" data-recalc-dims="1"></p>
<h2>Pipe Operator</h2>
<p>Use <code>Cmd+Shift+m</code> (for Mac) or <code>Ctrl+Shift+m</code> (for Windows). This adds the pipe operator %>% and spacing.</p>
<p><img src="https://i1.wp.com/www.rstudio.com/wp-content/uploads/2016/12/tips_pipeNEW.gif?w=456" data-recalc-dims="1"></p>
<h1>Easier R Markdown</h1>
<h2>R Markdown Options</h2>
<p>R Markdown output formats include arguments specified in the YAML header. Don’t worry about remembering all of the key-value pairs; in RStudio, you can access and change the most common through a user-interface:</p>
<p><img src="https://i0.wp.com/www.rstudio.com/wp-content/uploads/2016/12/tips_rmdoptions.gif?w=456" data-recalc-dims="1"></p>
<h2>Spell Checker</h2>
<p>Use the built-in spell checker when writing a R Markdown document. (Code chunks are automatically ignored.)</p>
<p><img src="https://i2.wp.com/www.rstudio.com/wp-content/uploads/2016/12/tips_spellcheck.gif?w=456" data-recalc-dims="1"></p>
<h2>SQL Code Chunks</h2>
<p>Execute SQL queries against database connections directly in R Markdown chunks.</p>
<p><img src="https://i2.wp.com/www.rstudio.com/wp-content/uploads/2016/12/tips_sql.jpg?w=456" data-recalc-dims="1"></p>
<h2>R Markdown Websites</h2>
<p>Are you building a <a target="_blank" rel="nofollow" href="http://rmarkdown.rstudio.com/rmarkdown_websites.html">website with R Markdown</a>? Any RStudio project with an R Markdown website will include a Build Website option in the build pane.</p>
<p><img src="https://i0.wp.com/www.rstudio.com/wp-content/uploads/2016/12/tips_buildpane.jpg?w=456" data-recalc-dims="1"></p>
<p>What’s your favorite RStudio Tip?</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.rstudio.com/rviews/2016/12/09/december-16-rstudio-tips-and-tricks/"> RStudio</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 title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/xt1kbc6bItY"></a></div>