You are currently browsing the category archive for the ‘Packages’ category.
RStudio maintains its own CRAN mirror, http://cran.rstudio.com. The server itself is a virtual machine run by Amazon’s EC2 service, and it syncs with the main CRAN mirror in Austria once per day. When you contact http://cran.rstudio.com, however, you’re probably not talking to our CRAN mirror directly. That’s because we use Amazon CloudFront, a content delivery network, which automatically distributes the content to locations all over the world. When you try to download a package from the Rstudio cloud mirror, it’ll be retrieved from a local CloudFront cache instead of the CRAN mirror itself. That means that, no matter where you are in the world, the data doesn’t need to travel very far, and so is fast to download.
To back this up with some data, we asked some friends to time downloads from all the CRAN mirrors. The RStudio mirror was not always the fastest (especially if you have a mirror nearby), but it was consistently fast around the world. (If you think you could improve on our testing methodology, the scripts and raw data are available at https://gist.github.com/hadley/5420147 – let us know what you come up with!)
You can use our mirror, even if you don’t use RStudio. (If you haven’t deliberately chosen a CRAN mirror in RStudio, we’ll use ours by default). It’s the first one in the list of mirrors (“0-Cloud”), or if you don’t want to select it every time you install a package, you can it as the default in your .Rprofile:
options(repos = c(CRAN = "http://cran.rstudio.com"))
Of course, speed isn’t the only factor you want to consider when choosing a mirror. Another important factor is reliability: is the mirror always available, and how often is it updated? CRAN provides the useful mirror monitoring report. Running a mirror is easy (it’s just a simple script run every few hours), so it’s a warning flag if a mirror has any non-green squares. We care about the availability of our mirror, and if it ever does go down, we’ll endeavour to fix it as quickly as possible.
Finally, because every download from a CRAN mirror is logged, CRAN mirrors provide a rich source of data about R and package usage. To date, it’s been hard to get access to this data. We wanted to change that, so you can now download our anonymised log data from cran-logs.rstudio.com. We’ve tried to strike a balance between utility and privacy. We’ve parsed the raw log data into fields that mean something to R users (like r version, architecture and os). The IP address is potentially revealing, so we’ve replaced it with a combination of country and a unique id within each day. This should make it possible to explore download patterns without undermining the privacy of the mirror users.
date time size r_version r_arch r_os date time size r_version r_arch r_os
1 2013-01-01 00:18:22 551371 2.15.2 x86_64 darwin9.8.0
2 2013-01-01 00:43:47 220277 2.15.2 x86_64 mingw32
3 2013-01-01 00:43:51 3505851 2.15.2 x86_64 mingw32
4 2013-01-01 00:43:53 761107 2.15.2 x86_64 mingw32
5 2013-01-01 00:31:15 187381 2.15.2 i686 linux-gnu
6 2013-01-01 00:59:46 2388932 2.15.2 x86_64 mingw32
package version country ip_id
1 knitr 0.9 RU 1
2 R.devices 2.1.3 US 2
3 PSCBS 0.30.0 US 2
4 R.oo 1.11.4 US 2
5 akima 0.5-8 US 3
6 spacetime 1.0-3 VN 4
Altogether, there’s currently around 150 megs of gzipped log files, representing over 7,000,000 package downloads. We’re looking forward to seeing what the R community does with this data, and we’ll highlight particularly interesting analyses in a future blog post. If you have any problems using the data, or you’d like to highlight a particularly interesting result, please feel free to email me.
We’re very pleased to announce the release of devtools 1.2. This version continues to make working with packages easier by increasing installation speed (skipping the build step unless local = FALSE), enhancing vignette handling (to support the non-Sweave vignettes available in R 3.0.0), and providing better default compiler flags for C and C++ code.
Also new in this release is the sha argument to source_url and source_gist. If provided, this checks that the file you download is what your expected, and is an important safety feature when running scripts over the web.
Devtools 1.2 contains many other bug fixes and minor improvements; to see them all, please read the NEWS file on github.
Shiny version 0.4.0 is now available on CRAN. The most visible change is that the API has been slightly simplified. Your existing code will continue to work, although Shiny will print messages about how to migrate your code. Migration should be straightforward, as described below. It will take a bit of work to switch to the new API, but we think it’s worth it in the long run, because the new interface is somewhat simpler, and because it offers a better mapping between function names and reactive programming concepts.
We’ve also updated the Shiny tutorial to reflect the changes, and we’ve also added a some new content explaining Shiny’s reactive programming model in depth. If you want to have a better understanding of how Shiny works, see the sections under Understanding Reactivity, starting with the Reactivity Overview.
Another new feature is that Shiny now suspends outputs when they aren’t visible on the user’s web browser. For example, if your Shiny application has multiple tabs or conditional panels, Shiny will only run the calculations and send data for the currently-visible tabs and panels. This new feature will reduce network traffic and computational load on the server, resulting in a faster application.
Version 0.3.0 of Shiny is now available on CRAN. This version of Shiny has several new features and bug fixes. Some of the changes are under the hood: for example, Shiny now uses a more efficient algorithm for scheduling the execution of reactive functions. There are also some user-facing changes: for example, the new runGitHub() function lets you download and run applications directly from a GitHub repository.
We’ve updated the tutorial page with documentation about these and other features. For a full list of changes, see the the NEWS file.
You can install the new version of Shiny with install.packages('shiny').
Shiny makes it easy to develop interactive web applications that run on your own machine. But by itself, it isn’t designed to make your applications available to all comers over the internet (or intranet). You can’t run more than one Shiny application on the same port, and if your R process crashes or exits for any reason, your service becomes unavailable.
Our solution is Shiny Server, the application server for Shiny. Using Shiny Server, you can host multiple Shiny applications, as well as static web content, on a Linux server and make them available over the internet. You can specify what applications are available at what URL, or configure Shiny Server to let anyone with a user account on the server deploy their own Shiny applications. For more details, see our previous blog post.
Shiny Server is available as a public beta today. Follow the instructions on our GitHub project page to get started now!
We’re pleased to announce new versions of ggplot2 (0.9.3) and plyr (1.8). To get up and running with the new versions, start a clean R session without ggplot2 or plyr loaded, and run install.packages(c("ggplot2", "gtable", "scales", "plyr")). Read on to find out what’s new.
ggplot2 0.9.3
Most of the changes version 0.9.3 are bug fixes. Perhaps the most visible change is that ggplot will now print out warning messages when you use stat="bin" and also map a variable to y. For example, these are valid:
ggplot(mtcars, aes(wt, mpg)) + geom_bar(stat = "identity")
ggplot(mtcars, aes(cyl)) + geom_bar(stat = "bin")
But this will result in some warnings:
ggplot(mtcars, aes(wt, mpg)) + geom_bar(stat = "bin")
# The default stat for geom_bar is "bin", so this is the same as above:
ggplot(mtcars, aes(wt, mpg)) + geom_bar()
The reason for this change is to make behavior more consistent – stat_bin generates a y value, and so should not work when you also map a value to y.
For a full list of changes, please see the NEWS file.
plyr 1.8
Version 1.8 has 28 improvements and bug fixes. Among the most prominent:
- All parallel plyr functions gain a
.paroptsargument, a list of options that is passed ontoforeachwhich allows you to control parallel execution. progress_timeis a new progress bar contributed by Mike Lawrence estimates the amount of time remaining before a job is complete- The summarise() function now calculates columns sequentially, so you can calculate new columns from other new columns, like this:
summarise(mtcars, x = disp/10, y = x/10)This behavior is similar to the mutate() function. Please be aware that this could change the behavior of existing code, if any columns of the output have the same name but different values as columns in the input. For example, this will result in different behavior in plyr 1.7 and 1.8:
summarise(mtcars, disp = disp/10, y = disp*10)In the old version, the y column would equal
mtcars$disp * 10, and in the new version, it would equalmtcars$disp. - There are a number of performance improvements:
a*plyuses more efficient indexing so should be more competitive withapply;d*ply,quickdf_dfandidata.frameall have performance tweaks which will help a few people out a lot, and a lot of people a little.
For a full list of changes, please see the NEWS file.
Last month we released Shiny, our new R package for creating interactive web applications. The response from the community has been extremely encouraging–we’ve received a lot of great feedback that has helped us to make significant improvements to the framework already!
Shiny 0.2.3 on CRAN
Starting with Shiny 0.2.3, you can install the latest stable version of Shiny directly from CRAN. Since the initial release, we’ve added some interesting features to Shiny, most notably the ability to offer on-the-fly file downloads. We’ve also fixed some bugs, including an issue with runGist that caused it to fail on many Windows systems.
Install or upgrade now by running: install.packages('shiny')
Coming soon: Shiny Server
While Shiny works great today for running apps on your own machine, we indicated in our original blog post that for web-based deployment we’d be offering hosting services and a software package for deploying Shiny applications on a server.
Today we have more details to share about Shiny Server, the software package which will allow you to deploy Shiny applications on your own server:
- Free and open source (AGPLv3 license)
- Host multiple applications on the same port, with a different URL path per application
- Allows Shiny applications to work with Internet Explorer 8 and 9
- Automatically starts and stops R sessions as needed
- Detects and recovers from crashed R sessions
- Designed to serve applications directly to browsers, or be proxied behind another web server like Apache/Nginx
- Works across network gateways and proxies that don’t support websockets
Our goal is to begin beta testing by the end of January. Shiny Server will require Linux at launch, though we will likely add Windows and Mac support later.
While we previously said that Shiny Server would be commercial software, we’ve decided to make it free and open source instead. Later in 2013 we hope to introduce a paid edition of Shiny Server that will include additional features that are targeted at larger organizations.
That’s all we have on the Shiny front for now. If you have questions, leave us a comment, or drop by our active and growing community at shiny-discuss!
Say hello to Shiny, a new R package that we’re releasing for public beta testing today.
Shiny makes it super simple for R users to turn analyses into interactive web applications that anyone can use. These applications let you specify input parameters using friendly controls like sliders, drop-downs, and text fields; and they can easily incorporate any number of outputs like plots, tables, and summaries.
No HTML or JavaScript knowledge is necessary. If you have some experience with R, you’re just minutes away from combining the statistical power of R with the simplicity of a web page:

More details, including live examples and a link to an extensive tutorial, can be found on the Shiny homepage.
The Shiny package is free and open source, and is designed primarily to run Shiny applications locally. To share Shiny applications with others, you can send them your application source as a GitHub gist, R package, or zip file (see details). We’re also working on a Shiny server that is designed to provide enterprise-grade application hosting, which we’ll offer as a subscription-based hosting service and/or commercial software package.
We’re really excited about Shiny, and look forward to seeing what kind of applications you come up with!
(Special thanks to Bryan Lewis for authoring the websockets package, which is used heavily by Shiny.)
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,DELETEandPOST. - 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_tokenandoauth2.0_tokento get user tokens, andsign_oauth1.0andsign_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.


