Editor’s note: This is a guest post by Matt Sundquist from Plot.ly.
Ggplotly and Plotly’s R API let you make ggplot2 plots, add py$ggplotly()
, and make your plots interactive, online, and drawn with D3. Let’s make some.
Here is Fisher’s iris data.
library("ggplot2")
ggiris <- qplot(Petal.Width, Sepal.Length, data = iris, color = Species)
print(ggiris)
Let’s make it in Plotly. Install:
install.packages("devtools")
library("devtools")
install_github("plotly", "ropensci")
Load.
library("plotly")
## Loading required package: RCurl
## Loading required package: bitops
## Loading required package: RJSONIO
Sign up online, use our public keys below, or sign up like this:
...Editor’s note: This is the first in a series of posts from rOpenSci’s recent hackathon.
I recently had the pleasure of participating in rOpenSci’s hackathon. To be honest, I was quite nervous to work among such notables, but I immediately felt welcome thanks to a warm and personable group. Alyssa Frazee has a great post summarizing the event, so check that out if you haven’t already. Once again, many thanks to rOpenSci for making it possible!
...We’ve received a number of questions from our users about dealing with the finer details of data sources on the web. Whether you’re reading data from local storage such as a csv file, a .Rdata
store, or possibly a proprietary file format, you’ve most likely run into some issues in the past. Common problems include passing incorrect paths, files being too big for memory, or requiring several packages to read files in incompatible formats. Reading data from the web entails a whole other set of challenges. Although there are many ways to obtain data from the web, this post primarily deals with retrieving data from Application Programming Interfaces also known as APIs....
The iNaturalist project is a really cool way to both engage people in citizen science and collect species occurrence data. The premise is pretty simple, users download an app for their smartphone, and then can easily geo reference any specimen they see, uploading it to the iNaturalist website. It let’s users turn casual observations into meaningful crowdsourced species occurrence data. They also provide a nice robust API to access almost all of their data. We’ve developed a package rinat
that can easily access all of that data in R. Our package spocc
uses iNaturalist data as one of it’s sources, rinat
provides an interface for all the features available in the API....
The rOpenSci projects aims to provide programmatic access to scientific data repositories on the web. A vast majority of the packages in our current suite retrieve some form of biodiversity or taxonomic data. Since several of these datasets have been georeferenced, it provides numerous opportunities for visualizing species distributions, building species distribution maps, and for using it analyses such as species distribution models. In an effort to streamline access to these data, we have developed a package called Spocc, which provides a unified API to all the biodiversity sources that we provide. The obvious advantage is that a user can interact with a common API and not worry about the nuances in syntax that differ between packages. As more data sources come online, users can access even more data without significant changes to their code. However, it is important to note that spocc will never replicate the full functionality that exists within specific packages. Therefore users with a strong interest in one of the specific data sources listed below would benefit from familiarising themselves with the inner working of the appropriate packages.
...