<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/rstudio-1-2-preview-stan/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://blog.rstudio.com/2018/10/16/rstudio-1-2-preview-stan/"> RStudio Blog</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p><img src="https://i0.wp.com/blog.rstudio.com/post/2018-10-16-rstudio-1-2-preview-stan_files/stan_logo.png?w=100&ssl=1" alt="Stan Logo" align="right" data-recalc-dims="1"></p>
<p>We previously discussed improved support in RStudio v1.2 for <a rel="nofollow" href="https://blog.rstudio.com/2018/10/02/rstudio-1-2-preview-sql/" target="_blank">SQL</a>, <a rel="nofollow" href="https://blog.rstudio.com/2018/10/05/r2d3-r-interface-to-d3-visualizations/" target="_blank">D3</a>, <a rel="nofollow" href="https://blog.rstudio.com/2018/10/09/rstudio-1-2-preview-reticulated-python/" target="_blank">Python</a>, and <a rel="nofollow" href="https://blog.rstudio.com/2018/10/11/rstudio-1-2-preview-cpp/" target="_blank">C/C++</a>. Today, we’re excited to announce improved support for the <a rel="nofollow" href="http://mc-stan.org/" target="_blank">Stan programming language</a>. The Stan programming language makes it possible for researchers and analysts to write high-performance and scalable statistical models.</p>
<blockquote>
<p>Stan® is a state-of-the-art platform for statistical modeling and high-performance statistical computation. Thousands of users rely on Stan for statistical modeling, data analysis, and prediction in the social, biological, and physical sciences, engineering, and business.</p>
</blockquote>
<p>With RStudio v1.2, we now provide:</p>
<ul>
<li>
<p>Improved, context-aware autocompletion for Stan files and chunks</p>
</li>
<li>
<p>A document outline, which allows for easy navigation between Stan code blocks</p>
</li>
<li>
<p>Inline diagnostics, which help to find issues while you develop your Stan model</p>
</li>
<li>
<p>The ability to interrupt Stan parallel workers launched within the IDE</p>
</li>
</ul>
<p>Together, these features bring the editing experience in Stan programs in-line with what you’re familiar with in R.</p>
<h2>Autocompletion</h2>
<p>RStudio provides autocompletion results for Stan functions, drawing from the set of pre-defined Stan keywords and functions. The same autocompletion features you might be familiar with in R, like fuzzy matching, are now also available in Stan programs.</p>
<p><img src="https://i0.wp.com/blog.rstudio.com/post/2018-10-16-rstudio-1-2-preview-stan_files/autocomplete.png?w=456&ssl=1" data-recalc-dims="1"></p>
<p>As with R, RStudio will also provide a small tooltip describing the arguments accepted by a particular function.</p>
<p><img src="https://i0.wp.com/blog.rstudio.com/post/2018-10-16-rstudio-1-2-preview-stan_files/autocomplete-2.png?w=456&ssl=1" data-recalc-dims="1"></p>
<h2>Document Outline</h2>
<p>The document outline allows for easy navigation between Stan blocks. This can be especially useful as your model definition grows in size, and you need to quickly reference the different blocks used in your program.</p>
<p><img src="https://i1.wp.com/blog.rstudio.com/post/2018-10-16-rstudio-1-2-preview-stan_files/document-outline.png?w=456&ssl=1" data-recalc-dims="1"></p>
<h2>Diagnostics</h2>
<p>RStudio now uses the Stan parser to provide inline diagnostics, and will report any problems discovered as you prepare your model.</p>
<p><img src="https://i0.wp.com/blog.rstudio.com/post/2018-10-16-rstudio-1-2-preview-stan_files/diagnostics.png?w=456&ssl=1" data-recalc-dims="1"></p>
<p>If the Stan compiler discovers any issues in your model, RStudio’s diagnostics will show you exactly where those issues live so you can fix them quickly and easily.</p>
<h2>Worker Interruption</h2>
<p>One aspect that had previously made working with Stan in RStudio frustrating was the inability to interrupt parallel Stan workers. This implied that attempts to fit a computationally expensive model could not be interrupted, and the only remedy previously was to restart the IDE or forcefully shut down the workers through another mechanism.</p>
<p>We’re very happy to share that this limitation has been lifted with RStudio v1.2. Now, when fitting a Stan model with parallel workers, you can interrupt the workers as you would any regular R code – either use the Escape key, or press the Stop button in the Console pane.</p>
<h2>Try it Out</h2>
<p>With the improvements to Stan integration coming in RStudio v1.2, getting started with Stan has never been easier. If you’d like to get more familiar with Stan, we think these resources will be helpful:</p>
<ul>
<li>Stan website: <a rel="nofollow" href="http://mc-stan.org/" target="_blank">http://mc-stan.org/</a></li>
<li>RStan “Getting Started” guide: <a rel="nofollow" href="https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started" target="_blank">https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started</a></li>
<li>Tutorials and Examples using Stan: <a rel="nofollow" href="http://mc-stan.org/users/documentation/tutorials" target="_blank">http://mc-stan.org/users/documentation/tutorials</a></li>
</ul>
<p>You can download the RStudio v1.2 Preview Release at <a rel="nofollow" href="https://www.rstudio.com/products/rstudio/download/preview/" target="_blank">https://www.rstudio.com/products/rstudio/download/preview/</a>. If you have any questions or comments, please get in touch with us on the <a rel="nofollow" href="https://community.rstudio.com/c/rstudio-ide" target="_blank">community forums</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://blog.rstudio.com/2018/10/16/rstudio-1-2-preview-stan/"> RStudio Blog</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/Xat_WyNyGfk" height="1"></a></div>