rOpenSci | Blog

All posts (Page 118 of 122)

A new tutorials setup

To help you use rOpenSci packages we put tutorials up on our site at /tutorials. Up to now, we created them with combination of raw html + converting code blocks to html and inserting them, etc. – it was a slow process to update them when changes happened in our packages.

So we thought of a better plan…

Recently CRAN started accepting R package vignettes (basically, tutorials built in to packages) in R Markdown format. This is great because executable Markdown with code plus text is easy to do with the help of knitr. And since our website is created using Jekyll, we can take our package vignettes with only text and code as a .Rmd file, convert to a .md file with text + code + the output of that code, insert some yaml metadata at the top, and have Jekyll automagically generate html pages. This may sound complicated, but once we have the vignette in a package, it’s just a few lines of code away from generating the html page for this site.

...

A task view for interacting with the web from R

There is an increasing set of R packages for interacting with the web from R, whether it be the low level tools to interact with the web via http (see RCurl and httr), parsing data from the web (like RJSONIO and XML), or wrappers to web APIs that provide data (like twitteR).

Most of you probably know about CRAN Task Views that aggregate information about R packages and functions on a particular subject area into a simple web page. There isn’t one for interacting with the web, so we have started drafting one on Github, and it is below.

...

Use cases as an interface to tool discovery

Good discovery tools for sotware are important as they can facilitate the pace of software development, bugs are found and squashed and new features added more quickly, and users find software they need faster. We have a page on our website for our packages that provides an overview of the packages we have, with descriptions and links.

Two other ways to discover things include

  • A gallery of examples, or use cases, in which the entry point is something someone would want to do. This is opposed to a list of software packages in which the entry point is a description of what the package does. Examples include the Rcpp gallery, R graph gallery, and the iPython Notebook Viewer gallery.
  • Images: Scrolling through images is a fast way to select an item of interest.

We just rolled out a new page for user stories, or use cases, organized in an gallery of thumbnail images with a brief description, which goes to another page with a brief script and output. Check it out. On this page we are gathering brief examples of tasks scientists can carry out in R. So far these include:

...

Working with climate data from the web in R

I recently attended ScienceOnline Climate, a conference in Washington, D.C. at AAAS. You may have heard of the ScienceOnline annual meeting in North Carolina - this was one of their topical meetings focused on Climate Change. I moderated a session on working with data from the web in R, focusing on climate data. Search Twitter for #scioClimate for tweets from the conference, and #sciordata for tweets from the session I ran. The following is an abbreviated demo of what I did in the workshop showing some of what you can do with climate data in R using our packages....

NOAA climate sparklines

We have started a new R package interacting with NOAA climate data called rnoaa. You can find our package in development here and documentation for NOAA web services here. It is still early days for this package, but we wanted to demo what you can do with the package.

In this example, we search for stations that collect climate data, then get the data for those stations, pull out only the precipitation data, then get latitude/longitude coordinates for each station, and plot data on a map.

...

Working together to push science forward

Happy rOpenSci users can be found at