You are currently browsing hadleywickham’s articles.
We’re pleased to announce a new version of roxygen2. The biggest news is that you can painlessly document your S4 classes, S4 methods and RC classes with roxygen2 – you can safely remove workarounds that used
@usage, and simply rely on roxygen2 to do the right thing. Roxygen2 is also much smarter when it comes to S3: you can remove existing uses of
@method, and can replace
Version 3.0 also includes many other improvements including better generation of usage, the ability to turn off wrapping in your Rd files and choose default roclets for a package, a safer
roxyngenize() if you prefer) and many other bug fixes and improvement. See the full list on the github release.
As always, you can install the latest version with
We’re pleased to announce two upcoming in-person training opportunities:
- Advanced R programming. SF, Dec 16-17.Learn the most important topics from advanced R programming in person. One day one, you’ll learn about metaprograming, functional programming and object oriented programming in R, as well general best practices for programming. Taught by Hadley Wickham, RStudio’s Chief Scientist.
- Public workshop. Boston, Jan 27-28.In this two-day workshop, you’ll get a comprehensive introduction to R, and you’ll be visualising, manipulating and modeling data in no time. Taught by Garrett Grolemund, RStudio Master Instructor
We have discounts available for students (66%) and academics (33%). Please contact Josh Paulson for details.
We’re very pleased to announce the release of devtools 1.4. This version brings many improvements to package installation, including automated vignette building, and a better way of referring to repos on github,
install_github("hadley/devtools"). There are also many other bug fixes and minor improvements; to see them all, please read the release notes file on github.
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_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.
We’re very pleased to announce the release of devtools 1.0. We’ve given devtools the 1.0 marker because it now works with the vast majority of packages in the wild, with this version adding support for S4 and Rcpp. Devtools also has completely revamped code for finding Rtools on windows, including much better error messages if something is wrong with your setup. In celebration of reaching 1.0, devtools now has it’s own webpage, which provides a bit more information about why you might want to use it.
Devtools 1.0 also contains many other bug fixes and minor improvements, as listed in the NEWS file on github.
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:
- Effective data visualisation and reports and reproducible research in San Francisco, Dec 3-4.
- Advanced R programming and package development in Washington DC, Dec 10-12.
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.
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:
- 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:
- support for OAuth 1.0 and 2.0. Use
oauth2.0_tokento get user tokens, 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).
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_allis much closer to installing and loading the package. It also compiles and loads C, C++ and Fortran code in the
- 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
--vanillamode and print the console command that’s run.
- Install github now allows you to install from pull request and private repositories.