At RStudio, we want you to be effective R users. As well as creating great software, we want to make it easier for you to master R. To this end, we’re very happy to announce our new training offerings.

We’re kicking off with two public courses:

We’ve also planned a number of other courses, based on our experience with the R community, seeing what’s hard to learn and what people are struggling with. These courses are available now if you’d like us to come to your company, and based on your feedback we’ll offer public versions in the near future.

You can also read about our instructors and our philosophy.

We’re happy to announce a new version of httr, a package designed to make it easy to work with web APIs. Httr is a wrapper around RCurl, and provides:

  • functions for the most important http verbs: GET, HEAD, PATCH, PUT, DELETE and POST.
  • automatic cookie handing across requests, connection sharing, and standard SSL config.
  • a request object which captures the body of the request along with request status, cookies, headers, timings and other useful information.
  • easy ways to access the response as a raw vector, a character vector, or parsed into an R object (for html, xml, json, png and jpeg).
  • wrapper functions for the most common configuration options: set_cookies, add_headers, authenticate, use_proxy, verbose, timeout.
  • support for OAuth 1.0 and 2.0. Use oauth1.0_token and oauth2.0_token to get user tokens, and sign_oauth1.0 and sign_oauth2.0to sign requests. The demos directory has six demos of using OAuth: three for 1.0 (linkedin, twitter and vimeo) and three for 2.0 (facebook, github, google).

Track httr’s development on github, and see what’s new in this version.

The latest version of lubridate offers some powerful new features and huge speed improvements. Some areas, such as date parsing are more than 50 times faster. lubridate 1.2.0 also fixes those pesky NA bugs in 1.1.0. Here’s some of what you’ll find:

Parsers can now handle a wider variety date formats, even within the same vector

dates <- c("January 31, 2010", "2-28-2010", "03/31/2000")
dates <- mdy(dates)
## [1] "2010-01-31 UTC" "2010-02-28 UTC" "2000-03-31 UTC

Stamp lets you display dates however you like, by emulating an example date

stamper <- stamp("1 March 1999")
stamper(dates)
[1] "31 January 2010"  "28 February 2010" "31 March 2000"

New methods add months without rolling past the end of short months. Its hard to find a satisfactory way to implement addition with months, but the %m+% and %m-% operators provide a new option that wasn’t available before.

ymd("2010-01-31") %m+% months(1:3)
[1] "2010-02-28 UTC" "2010-03-31 UTC" "2010-04-30 UTC"

lubridate 1.2.0 includes many awesome ideas and patches submitted by lubridate users, so check out what is new. For a complete list of new features and contributors, see the package NEWS file on github.

Using the web logs collected when users download RStudio, we’ve prepared the following two maps showing where RStudio is being used, over the whole globe and just within the continental USA. Obviously this data is somewhat biased, as it reflects the number of downloads of RStudio, rather than the number of users of R (which we’d really love to know!). However, based on a month’s worth of data, we think the broad patterns are pretty interesting.


We made the maps by translating IP addresses to latitude and longitude with the free GeoIP databases provided by MaxMind. To make it easier to see the main patterns for each map, we used k-means clustering to group the original locations into 300 clusters for the world and 100 clusters for the US,  then used ggplot2 to display the number of users in each cluster with the area of each bubble.

We’re pleased to announce a new version of devtools, the package that makes R package development easy. The main features in this version are:

  • A complete rewrite of the code loading system which simulates namespace loading much more accurately – this means using load_all is much closer to installing and loading the package. It also compiles and loads C, C++ and Fortran code in the src/ directory.
  • All devtools command now only take a path to a package and default to using the working directory if no path is supplied.
  • All R commands are run in --vanilla mode and print the console command that’s run.
  • Install github now allows you to install from pull request and private repositories.

Plus much, much more – for a complete list of changes, see the NEWS on github. If you’re interested in package development with devtools you may also want to join the rdevtools mailing list.

The main changes in this version are to the theming system. There are also a number of enhancements to the theming system that make it easier to modify themes and we’ve renamed a number of functions to have more informative names. Your existing code should continue to work, although you may receive warnings about functions that have been deprecated. Replacing them with new versions is easy. Here are the changes you are likely to encounter:

  • opts() is deprecated. You can simply replace it with theme() in your code.
  • theme_blank(), theme_text(), theme_rect(), theme_line(), and theme_segment() are deprecated. You can replace them with element_blank(), element_text(), element_rect(), and element_line().
  • Previously, the way to set the title of a plot was opts(title="Title text"). In the new version, use ggtitle("Title text") or labs(title="Title text").

Other improvements include the addition of stat_ecdf, defaulting to the colour bar legend for continuous colour scales, nicer default breaks, better documentation and much more (including many bug fixes). You can read the complete list of changes on the development site

RStudio’s mission from the beginning has been to create powerful tools that support the practices and techniques required for creating trustworthy, high quality analysis. For many years Hadley Wickham has been teaching and working on his own set of tools for R with many of the same core goals. We’ve been collaborating quite a bit with Hadley over the past couple of years and today we’re excited to announce that Hadley, Winston Chang, and Garrett Grolemund are joining RStudio so we can continue to work together much more closely.

You probably know Hadley from his work on ggplot2, plyr, and many other packages. Garrett was a PhD student of Hadley’s at Rice, and you might also know him from the lubridate package, which makes dealing with dates and time easier; he’s also been working on new tools for visualisation and new ways of thinking about the process of data analysis. Winston has been working full-time on ggplot2 for the last couple of months, squashing many bugs and repaying a lot of the technical debt that’s accumulated over the years. Winston’s also writing an R Graphics Cookbook for O’Reilly that should be available in the near future.

What does this mean for RStudio? We’ll of course continue developing open-source software like the RStudio IDE, ggplot2, and plyr (among many other projects). One of Hadley’s core focuses at RStudio will also be expanding our mission to include education, which we plan to offer in a variety of formats ranging from in-person training to some innovative new online courses. We’ll also be working on hosted services (like RPubs) as well as some new products that address the challenges of deploying R within larger organizations.

We’re all excited to begin this next phase of work together and will have lots more details to announce later this fall!

Today we’re very excited to announce RPubs, a free service that makes it easy to publish documents to the web from R. RPubs is a quick and easy way to disseminate data analysis and R code and do ad-hoc collaboration with peers.

RPubs documents are based on R Markdown, a new feature of knitr 0.5 and RStudio 0.96. To publish to RPubs within RStudio, you simply create an R Markdown document then click the Publish button within the HTML Preview window:

RPubs documents include a moderated comment stream for feedback and dialog with readers, and can be updated with changes by publishing again from within RStudio.

Note that you’ll only see the Publish button if you update to the latest version of RStudio (v0.96.230, available for download today).

The markdown package

RStudio has integrated support for working with R Markdown and publishing to RPubs, but we also want to make sure that no matter what tools you use it’s still possible to get the same results. To that end we’ve also been working on a new version of the markdown package (v0.5, available now on CRAN).

The markdown package provides a standalone implementation of R Markdown rendering that can be integrated with other editors and IDEs. The package includes a function to upload to RPubs, but is also flexible enough to support lots of other web publishing scenarios. We’ve been working with Jeff Horner on this and he has a more detailed write-up on the capabilities of the markdown package on his blog.

Gallery of examples

We’ve also published a gallery of example documents on RPubs—the gallery illustrates some of the most useful techniques for getting the most out of R Markdown, and includes the following articles:

Let us know what additional examples you’d like to see—we’ll be adding more in the weeks ahead.

We’ve just a made a change to the syntax for embedding MathJax equations in R Markdown documents. The change was made to eliminate some parsing ambiguities and to support future extensibility to additional formats.

The revised syntax adds a “latex” qualifier to the $ or $$ equation begin delimiter. It looks like this:

This change was the result of a few considerations:

  1. Some users encountered situations where the $<equation>$ syntax recognized standard text as an equation. There was an escape sequence (\$) to avoid this but for users not explicitly aware of MathJax semantics this was too hard to discover.
  2. The requirement to have no space between equation delimiters ($) and the equation body (intended to reduce parsing ambiguity) was also confusing for users.
  3. We want to eventually support ASCIIMath and for this will require an additional qualifier to indicate the equation format.

RStudio v0.96.227 implements the new MathJax syntax and is available for download now.

There’s been lots of excitement about the new R Markdown feature introduced as part of knitr 0.5 and RStudio 0.96. People see R Markdown as both a simpler way to do reproducible research and as a great way to publish to the web from R. Jeromy Anglim has a nice write up on getting started with R Markdown and Marcus Gesmann describes how to embed Google Visualizations using his googleVis package.

We are just as excited about R Markdown and think there is lots more that can be done with it. We’ll be talking about this along with Yihui Xie (author of knitr) and Jeff Horner (author of R/Apache and Rook) on Tuesday June 5th in New York:

http://www.meetup.com/nyhackr/events/64279002/

At the meetup we’ll be showing the latest versions of knitr and RStudio and will be announcing some new R Markdown stuff—if you are in New York we’d love to see you there!

About

RStudio™ is an open-source integrated development environment (IDE) for R.

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 359 other followers

Follow

Get every new post delivered to your Inbox.

Join 359 other followers