You are currently browsing the monthly archive for October 2016.
It’s nearly summeRtime in Australia! Join RStudio Chief Data Scientist Hadley Wickham for his popular Master R workshop in Melbourne.
Melbourne will be Hadley’s first and only scheduled Master R workshop in Australia. Whether you live or work nearby or you just need one more good reason to visit Melbourne in the Southern Hemisphere spring, consider joining him at the Cliftons Melbourne on December 12th and 13th. It’s a rare opportunity to learn from one of the R community’s most popular and innovative authors and package developers.
Hadley’s workshops usually sell out. This is his final Master R in 2016 and he has no plans to offer another in the area in 2017. If you’re an active R user and have been meaning to take this class, now is the perfect time to do it!
We look forward to seeing you in Melbourne!
We are excited to announce that submissions for lightning talks at rstudio::conf are now open! Lightning talks are short (5 minute) high energy presentations that give you the chance to talk about an interesting project that you’ve tackled with R. Short talks, or demos of your R code, R packages, and shiny apps are great options. See some of the great lightning talks from the Shiny Developer Conference (scroll down to user talks).
Submissions are due December 1, 2016. We’ll announce the accepted talks on December 15. (You must be a registered attendee of rstudio::conf to present a lightning talk.)
Shiny Server 22.214.171.1245 and Shiny Server Pro 126.96.36.1996 are now available! This release includes new features to support Shiny 0.14. It also updates our Node.js to 0.10.47, which includes important security fixes for SSL/TLS.
Connection robustness (a.k.a. grey-outs)
Shiny’s architecture is built on top of websockets, which are long-lived network connections between the browser and an R session on the server. If this connection is broken for any reason, the browser is no longer able to communicate with its R session on the server. Shiny indicates this to the user by turning the page background grey and fading out the page contents.
In Shiny 0.14 and Shiny Server 1.4.7, we’ve done work at both the server and package levels to minimize the amount of greyouts users will see. Simply by upgrading Shiny Server, transient (<15sec) network interruptions should no longer disrupt Shiny apps. And for many Shiny apps, a secondary, opt-in reconnection mechanism should all but eliminate grey-outs. This article on shiny.rstudio.com has all the details.
Shiny 0.14 introduced a “bookmarkable state” feature that made it possible to snapshot the state of a running Shiny app, and send it to someone as a URL to try in their own browser. At the app author’s option, the app state could either be fully encoded in the URL, or written to disk and referred to by a short ID. This latter approach requires support from the server, and that support is now officially provided by Shiny Server and Shiny Server 1.4.7. (This functionality is not yet available for ShinyApps.io, however.)
Coming soon: Shiny Server 1.5.0
Just a heads up: Shiny Server (Pro) 1.5.0 is coming in a few weeks. Shiny Server was originally written using Node.js 0.10, which is nearing the end of its lifespan. This release will move to Node.js 6.x.
Due to the complexity of this upgrade, Shiny Server 1.5.0 will not add any new features, except for supporting perfect forward secrecy for SSL/TLS connections. The focus will be entirely on ensuring a smooth and stable release.
rstudio::conf 2017, the conference on all things R and RStudio, is only 90 days away. Now is the time to claim your spot or grab one of the few remaining seats at Training Days – including the new Tidyverse workshop.
Whether you’re already registered or still working on it, we’re delighted today to announce the full conference schedule, so that you can plan your days in Florida.
rstudio::conf 2017 takes place January 12-14 at the Gaylord Resorts in Kissimmee, Florida. There are over 30 talks and tutorials to choose from that are sure to accelerate your productivity in R and RStudio. In addition to the highlights below, topics include the latest news on R notebooks, sparklyr, profiling, the tidyverse, shiny, r markdown, html widgets, data access and the new enterprise-scale publishing capabilities of RStudio Connect.
– Hadley Wickham, Chief Scientist, RStudio: Data Science in the Tidyverse
– Andrew Flowers, Economics Writer, FiveThirtyEight: Finding and Telling Stories with R
– J.J. Allaire, Software Engineer, CEO & Founder: RStudio Past, Present and Future
– Winston Chang, Software Engineer, RStudio: Building Dashboards with Shiny
– Charlotte Wickham, Oregon State University: Happy R Users Purrr
– Yihui Xie, Software Engineer, RStudio: Advanced R Markdown
– Jenny Bryan, University of British Columbia: Happy Git and GitHub for the UseR
– Max Kuhn, Senior Director Non-Clinical Statistics, Pfizer
– Dirk Eddelbuettel, Ketchum Trading: Extending R with C++: A Brief Introduction to Rcpp
– Hilary Parker, Stitch Fix: Opinionated Analysis Development“
– Bryan Lewis, Paradigm4: “Fun with htmlwidgets”
– Ryan Hafen, Hafen Consulting: “Interactive plotting with rbokeh and crosstalk”
– Julia Silge, Datassist: “Text mining, the tidy way”
– Bob Rudis, Rapid7: “Writing readable code with pipes”
– Joseph Rickert, R Ambassador, RStudio: R’s Role in Data Science
Special Reminder: When you register, make sure you purchase your ticket for Friday evening at Universal’s Wizarding World of Harry Potter. The park is reserved exclusively for rstudio::conf attendees. It’s an extraordinary experience we’re sure you’ll enjoy!
We appreciate our sponsors and exhibitors!
If there’s one word that could describe the default styling of Shiny applications, it might be “minimalist.” Shiny’s UI components are built using the Bootstrap web framework, and unless the appearance is customized, the application will be mostly white and light gray.
Fortunately, it’s easy to add a bit of flavor to your Shiny application, with the shinythemes package. We’ve just released version 1.1.1 of shinythemes, which includes many new themes from bootswatch.com, as well as a theme selector which you can use to test out different themes on a live Shiny application.
Here’s an example of the theme selector in use (try out the app here):
To install the latest version of shinythemes, run:
To use the theme selector, all you need to do is add this somewhere in your app’s UI code:
Once you’ve chosen which theme you want, all you need to do is use the
theme argument of the
fixedPage functions. If you want to use “cerulean”, you would do this:
fluidPage(theme = shinytheme("cerulean"), ... )
To learn more and see screenshots of the different themes, visit the shinythemes web page. Enjoy!
Today we’re excited to announce R Notebooks, which add a powerful notebook authoring engine to R Markdown. Notebook interfaces for data analysis have compelling advantages including the close association of code and output and the ability to intersperse narrative with computation. Notebooks are also an excellent tool for teaching and a convenient way to share analyses.
You can try out R Notebooks today in the RStudio Preview Release.
Interactive R Markdown
As an authoring format, R Markdown bears many similarities to traditional notebooks like Jupyter and Beaker. However, code in notebooks is typically executed interactively, one cell at a time, whereas code in R Markdown documents is typically executed in batch.
R Notebooks bring the interactive model of execution to your R Markdown documents, giving you the capability to work quickly and iteratively in a notebook interface without leaving behind the plain-text tools and production-quality output you’ve come to rely on from R Markdown.
|R Markdown Notebooks||Traditional Notebooks|
|Plain text representation||✓|
|Same editor/tools used for R scripts||✓|
|Works well with version control||✓|
|Focus on production output||✓|
|Output inline with code||✓||✓|
|Output cached across sessions||✓||✓|
|Share code and output in a single file||✓||✓|
|Emphasized execution model||Interactive & Batch||Interactive|
This video provides a bit more background and a demonstration of notebooks in action:
In a typical R Markdown document, you must re-knit the document to see your changes, which can take some time if it contains non-trivial computations. R Notebooks, however, let you run code and see the results in the document immediately. They can include just about any kind of content R produces, including console output, plots, data frames, and interactive HTML widgets.
You can see the progress of the code as it runs:
You can preview the results of individual inline expressions, too:
Even your LaTeX equations render in real-time as you type:
This focused mode of interaction doesn’t require you to keep the console, viewer, or output panes open. Everything you need is at your fingertips in the editor, reducing distractions and helping you concentrate on your analysis. When you’re done, you’ll have a formatted, reproducible record of what you’ve accomplished, with plenty of context, perfect for your own records or sharing with others.
R Notebooks can run more than just R code. You can run chunks written in other languages, like Python, Bash, or C++ (Rcpp).
It’s even possible to run SQL directly:
This makes an R Notebook an excellent tool for orchestrating a reproducible, end-to-end data analysis workflow; you can easily ingest data using your tool of choice, and share data among languages by using packages like feather, or ordinary CSV files.
While you can run chunks (and even individual lines of R code!) in any order you like, a fully reproducible document must be able to be re-executed start-to-finish in a clean environment. There’s a built-in command to do this, too, so it’s easy to test your notebooks for reproducibility.
Rich Output Formats
Since they’re built on R Markdown, R Notebooks work seamlessly with other R Markdown output types. You can use any existing R Markdown document as a notebook, or render (knit) a notebook to any R Markdown output type.
The same document can be used as a notebook when you’re quickly iterating on ideas and later rendered to a wholly different format for publication – no duplication of code, data, or output required.
I’m pleased to announce the release of haven. Haven is designed to faciliate the transfer of data between R and SAS, SPSS, and Stata. It makes it easy to read SAS, SPSS, and Stata file formats in to R data frames, and makes it easy to save your R data frames in to SAS, SPSS, and Stata if you need to collaborate with others using closed source statistical software. Install haven by running:
haven 1.0.0 is a major release, and indicates that haven is now largely feature complete and has been tested on many real world datasets. There are four major changes in this version of haven:
- Improvements to the underlying ReadStat library
- Better handling of “special” missing values
- Improved date/time support
- Support for other file metadata.
There were also a whole bunch of other minor improvements and bug fixes: you can see the complete list in the release notes.
- Can read binary/Ross compressed SAS files.
- Support for reading and writing Stata 14 data files.
write_sas()allows you to write data frames out to
sas7bdatfiles. This is still somewhat experimental.
read_por()now actually works.
- Many other bug fixes and minor improvements.
haven 1.0.0 includes comprehensive support for the “special” types of missing values found in SAS, SPSS, and Stata. All three tools provide a global “system missing value”, displayed as
.. This is roughly equivalent to R’s
NA, although neither Stata nor SAS propagate missingness in numeric comparisons (SAS treats the missing value as the smallest possible number and Stata treats it as the largest possible number).
Each tool also provides a mechanism for recording multiple types of missingness:
- Stata has “extended” missing values,
- SAS has “special” missing values,
- SPSS has per-column “user” missing values. Each column can declare up to three distinct values or a range of values (plus one distinct value) that should be treated as missing.
Stata and SAS only support tagged missing values for numeric columns. SPSS supports up to three distinct values for character columns. Generally, operations involving a user-missing type return a system missing value.
Haven models these missing values in two different ways:
- For SAS and Stata, haven provides
tagged_na()which extend R’s regular
NAto add a single character label.
- For SPSS, haven provides
labelled_spss()that also models user defined values and ranges.
zap_missing() if you just want to convert to R’s regular
You can get more details in the semantics vignette.
Support for date/times has substantially improved:
read_dta()now recognises “%d” and custom date types.
read_sav()now correctly recognises EDATE and JDATE formats as dates. Variables with format DATE, ADATE, EDATE, JDATE or SDATE are imported as
Datevariables instead of
write_sav()support writing date/times.
- Support for
hms()has been moved into the hms package. Time varibles now have class
c("hms", "difftime")and a
unitsattribute with value “secs”.
Haven is slowly adding support for other types of metadata:
- Variable formats can be read and written. Similarly to to variable labels, formats are stored as an attribute on the vector. Use
zap_formats()if you want to remove these attributes.
- Added support for reading file “label” and “notes”. These are not currently printed, but are stored in the attributes if you need to access them.