<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title>Recology - R</title>
		<description>Posts tagged as 'R'</description>
		<link>http://schamberlain.github.io</link>
		
			<item>
				<title>Stashing and playing with raw data locally from the web</title>
				<description>&lt;p&gt;It is getting easier to get data directly into R from the web. Often R packages that retrieve data from the web return useful R data structures to users like a data.frame. This is a good thing of course to make things user friendly.&lt;/p&gt;

&lt;p&gt;However, what if you want to drill down into the data that's returned from a query to a database in R?  What if you want to get that nice data.frame in R, but you think you may want to look at the raw data later? The raw data from web queries are often JSON or XML data. This type of data, especially JSON, can be easily stored in schemaless so-called NoSQL databases, and queried later.&lt;/p&gt;

&lt;p&gt;A brief aside: What are JSON and XML? This is what JSON looks like (ps if you ever wonder if your JSON is correct, go &lt;a href=&quot;http://jsonlint.com/&quot;&gt;here&lt;/a&gt;):&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&amp;quot;name&amp;quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&amp;quot;joe&amp;quot;&lt;/span&gt;,
  &lt;span class=&quot;s2&quot;&gt;&amp;quot;hobby&amp;quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&amp;quot;codemonkey&amp;quot;&lt;/span&gt;,
  &lt;span class=&quot;s2&quot;&gt;&amp;quot;lives&amp;quot;&lt;/span&gt;: &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;
      &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
          &lt;span class=&quot;s2&quot;&gt;&amp;quot;city&amp;quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&amp;quot;San Jose&amp;quot;&lt;/span&gt;,
          &lt;span class=&quot;s2&quot;&gt;&amp;quot;state&amp;quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&amp;quot;CA&amp;quot;&lt;/span&gt;
      &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;This is what XML looks like:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&amp;lt;?xml &lt;span class=&quot;nv&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;encoding&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;UTF-8&amp;quot;&lt;/span&gt; ?&amp;gt;
  &amp;lt;name&amp;gt;joe&amp;lt;/name&amp;gt;
    &amp;lt;hobby&amp;gt;codemonkey&amp;lt;/hobby&amp;gt;
    &amp;lt;lives&amp;gt;
        &amp;lt;city&amp;gt;San Jose&amp;lt;/city&amp;gt;
        &amp;lt;state&amp;gt;CA&amp;lt;/state&amp;gt;
    &amp;lt;/lives&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;But don't worry if it looks complicated - the project I talk about below, sofa, tries to make the interface to JSON and XML easy. Web APIs almost always return either JSON or XML, so this is the raw data.&lt;/p&gt;

&lt;p&gt;So here's the use case I imagine, or workflow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Query a database on the web, and choose to write the raw data to a local database.&lt;/li&gt;
&lt;li&gt;Do whatever you want with the output R object - analyze, visualize, etc.&lt;/li&gt;
&lt;li&gt;Now you want to go back and search through some of the raw data. But, that query took an hour. Since you wrote it to a local database, you can search the data.&lt;/li&gt;
&lt;li&gt;If you hadn't written it locally, you would have to make a new web call.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Note that if you are doing calls to web APIs that get small amounts of data you don't need to worry too much as you can easily just do the call again.&lt;/p&gt;

&lt;p&gt;I've started an R package to interact with the NoSQL database &lt;a href=&quot;http://couchdb.apache.org/&quot;&gt;CouchDB&lt;/a&gt;. CouchDB is a schemaless database that speaks JSON, so you can store JSON and get back JSON (don't worry XML, we got you covered - we can just wrap the XML in JSON before putting it in CouchDB). What's especially cool is you can interact with CouchDB via &lt;a href=&quot;http://docs.couchdb.org/en/latest/api-basics.html&quot;&gt;a RESTful API&lt;/a&gt;. CouchDB doesn't have full text search built in (though you can build map-reduce &lt;em&gt;Views&lt;/em&gt;, basically preset queries on the database), so I added functions (and docs to help) to interact with the &lt;a href=&quot;https://github.com/elasticsearch/elasticsearch-river-couchdb/blob/master/README.md&quot;&gt;CouchDB River plugin&lt;/a&gt; for &lt;a href=&quot;http://www.elasticsearch.org/&quot;&gt;Elasticsearch&lt;/a&gt;, which provides powerful full text search via an API interface. But nevermind the tech details - all this just means you can search on the full text of your stored data.&lt;/p&gt;

&lt;p&gt;There are plenty of databases you can interact with from R, so why CouchDB? For one, it makes a lot of sense to write to a NoSQL database since this blog post is dealing with a use case writing JSON, which isn't a good fit for databases like MySQL, SQLite, PostgreSQL, etc. (&lt;a href=&quot;http://wiki.postgresql.org/wiki/What's_new_in_PostgreSQL_9.2#JSON_datatype&quot;&gt;though postgres allows you to write JSON&lt;/a&gt;). It didn't have to be CouchDB, but at least to me it seems relatively easy to install, you can interact with it via an HTTP API (if you're into that, which I am), and it has a nice web interface (navigate to &lt;a href=&quot;http://localhost:5984/_utils/&quot;&gt;http://localhost:5984/_utils/&lt;/a&gt; after starting &lt;code&gt;couchdb&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Is this for the casual R user? Probably not. But, I imagine there are R users out there that want some more flexibility when it comes to interacting with web data in R. It is nice and tidy to get back an R data.frame from a web call, but having the raw data at your fingertips could be super powerful. I'll describe using an R package to interact with a web database with &lt;code&gt;sofa&lt;/code&gt; baked in, and discuss a bit about the functions within &lt;code&gt;sofa&lt;/code&gt;.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3&gt;First start CouchDB in your terminal&lt;/h3&gt;

&lt;p&gt;You can do this from anywhere in your directory. See &lt;a href=&quot;http://couchdb.apache.org/&quot;&gt;here&lt;/a&gt; for instructions on how to install CouchDB.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;bash
couchdb
&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Then start elasticsearch in your terminal&lt;/h3&gt;

&lt;p&gt;See &lt;a href=&quot;https://github.com/schamberlain/sofa&quot;&gt;here&lt;/a&gt; for instructions on how to install Elasticsearch and the River CouchDB plugin.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;bash
cd /usr/local/elasticsearch
bin/elasticsearch -f
&lt;/code&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h3&gt;Install sofa&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# Uncomment these lines if you don&amp;#39;t have these packages installed&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# install.packages(&amp;#39;devtools&amp;#39;) library(devtools) install_github(&amp;#39;sofa&amp;#39;,&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# &amp;#39;schamberlain&amp;#39;) install_github(&amp;#39;alm&amp;#39;, &amp;#39;ropensci&amp;#39;, ref=&amp;#39;couch&amp;#39;)&lt;/span&gt;
library&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;sofa&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
library&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;alm&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h3&gt;Simultaneously write data to CouchDB along with API calls using the alm package to get altmetrics data on PLoS papers. Ping to make sure CouchDB is on&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;sofa_ping&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;  couchdb   version 
&amp;quot;Welcome&amp;quot;   &amp;quot;1.2.1&amp;quot; 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h3&gt;Create a new database&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;sofa_createdb&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;dbname &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;alm_db&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;  ok 
TRUE 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h3&gt;Write couchdb database name to options&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;options&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;couch_db_name &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;alm_db&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h3&gt;List the databases&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;sofa_listdbs&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt; [1] &amp;quot;_replicator&amp;quot;                &amp;quot;_users&amp;quot;                    
 [3] &amp;quot;alm_couchdb&amp;quot;                &amp;quot;alm_db&amp;quot;                    
 [5] &amp;quot;dudedb&amp;quot;                     &amp;quot;example&amp;quot;                   
 [7] &amp;quot;poop&amp;quot;                       &amp;quot;rplos_db&amp;quot;                  
 [9] &amp;quot;shit&amp;quot;                       &amp;quot;shitty&amp;quot;                    
[11] &amp;quot;shitty2&amp;quot;                    &amp;quot;test_suite_db&amp;quot;             
[13] &amp;quot;test_suite_db/with_slashes&amp;quot; &amp;quot;test_suite_reports&amp;quot;        
[15] &amp;quot;testr2couch&amp;quot;                &amp;quot;twitter_db&amp;quot;                
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h3&gt;Search for altmetrics normally, w/o writing to a database&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;head&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;alm&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;doi &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1371/journal.pone.0029797&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;          .id pdf html shares groups comments likes citations total
1   bloglines  NA   NA     NA     NA       NA    NA         0     0
2   citeulike  NA   NA      1     NA       NA    NA        NA     1
3    connotea  NA   NA     NA     NA       NA    NA         0     0
4    crossref  NA   NA     NA     NA       NA    NA         6     6
5      nature  NA   NA     NA     NA       NA    NA         4     4
6 postgenomic  NA   NA     NA     NA       NA    NA         0     0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h3&gt;Search for altmetrics normally, while writing to a database&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;head&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;alm&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;doi &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1371/journal.pone.0029797&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; write2couch &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;TRUE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;          .id pdf html shares groups comments likes citations total
1   bloglines  NA   NA     NA     NA       NA    NA         0     0
2   citeulike  NA   NA      1     NA       NA    NA        NA     1
3    connotea  NA   NA     NA     NA       NA    NA         0     0
4    crossref  NA   NA     NA     NA       NA    NA         6     6
5      nature  NA   NA     NA     NA       NA    NA         4     4
6 postgenomic  NA   NA     NA     NA       NA    NA         0     0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h3&gt;Make lots of calls, and write them simultaneously&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# install_github(&amp;#39;rplos&amp;#39;, &amp;#39;ropensci&amp;#39;)&lt;/span&gt;
library&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;rplos&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
dois &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; searchplos&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;terms &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;evolution&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; fields &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;id&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; limit &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
out &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; alm&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;doi &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; as.character&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;dois&lt;span class=&quot;p&quot;&gt;[,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]),&lt;/span&gt; write2couch &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;TRUE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
lapply&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;out&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; head&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;$`01`
          .id pdf html shares groups comments likes citations total
1   bloglines  NA   NA     NA     NA       NA    NA         0     0
2   citeulike  NA   NA      0     NA       NA    NA        NA     0
3    connotea  NA   NA     NA     NA       NA    NA         0     0
4    crossref  NA   NA     NA     NA       NA    NA         0     0
5      nature  NA   NA     NA     NA       NA    NA         0     0
6 postgenomic  NA   NA     NA     NA       NA    NA         0     0

$`02`
          .id pdf html shares groups comments likes citations total
1   bloglines  NA   NA     NA     NA       NA    NA         0     0
2   citeulike  NA   NA      1     NA       NA    NA        NA     1
3    connotea  NA   NA     NA     NA       NA    NA         0     0
4    crossref  NA   NA     NA     NA       NA    NA         2     2
5      nature  NA   NA     NA     NA       NA    NA         0     0
6 postgenomic  NA   NA     NA     NA       NA    NA         0     0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h3&gt;Writing data to CouchDB does take a bit longer&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;system.time&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;alm&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;doi &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; as.character&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;dois&lt;span class=&quot;p&quot;&gt;[,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;60&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; write2couch &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;FALSE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;   user  system elapsed 
  1.739   0.016   4.554 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;system.time&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;alm&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;doi &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; as.character&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;dois&lt;span class=&quot;p&quot;&gt;[,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;60&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; write2couch &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;TRUE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;   user  system elapsed 
  3.579   0.062   6.460 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h3&gt;Search using elasticsearch&lt;/h3&gt;

&lt;h4&gt;tell elasticsearch to start indexing your database&lt;/h4&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;elastic_start&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;dbname &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;alm_db&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;$ok
[1] TRUE
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h4&gt;Search your database&lt;/h4&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;out &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; elastic_search&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;dbname &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;alm_db&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; q &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;twitter&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; parse_ &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;TRUE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
out&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;hits&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;total
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;[1] 679
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h3&gt;Using views&lt;/h3&gt;

&lt;h4&gt;Write a view - here letting key be the default of null&lt;/h4&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;sofa_view_put&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;dbname &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;alm_db&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; design_name &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;myview&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; value &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;doc.baseurl&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;$ok
[1] TRUE

$id
[1] &amp;quot;_design/myview&amp;quot;

$rev
[1] &amp;quot;1-e7c17cff1b96e4595c3781da53e16ad8&amp;quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h4&gt;Get info on your new view&lt;/h4&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;sofa_view_get&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;dbname &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;alm_db&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; design_name &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;myview&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;$`_id`
[1] &amp;quot;_design/myview&amp;quot;

$`_rev`
[1] &amp;quot;1-e7c17cff1b96e4595c3781da53e16ad8&amp;quot;

$views
$views$foo
                                    map 
&amp;quot;function(doc){emit(null,doc.baseurl)}&amp;quot; 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h4&gt;Get data using a view&lt;/h4&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;out &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; sofa_view_search&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;dbname &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;alm_db&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; design_name &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;myview&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
length&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;out&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;rows&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;c1&quot;&gt;# 160 results&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;[1] 161
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;sapply&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;out&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;rows&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;x&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; x&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;value&lt;span class=&quot;p&quot;&gt;)[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;  &lt;span class=&quot;c1&quot;&gt;# the values, just the API call URLs&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;[1] &amp;quot;http://alm.plos.org/api/v3/articles&amp;quot;
[2] &amp;quot;http://alm.plos.org/api/v3/articles&amp;quot;
[3] &amp;quot;http://alm.plos.org/api/v3/articles&amp;quot;
[4] &amp;quot;http://alm.plos.org/api/v3/articles&amp;quot;
[5] &amp;quot;http://alm.plos.org/api/v3/articles&amp;quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h4&gt;Delete the view&lt;/h4&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;sofa_view_del&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;dbname &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;alm_db&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; design_name &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;myview&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;[1] &amp;quot;&amp;quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h2&gt;What now?&lt;/h2&gt;

&lt;p&gt;Well, if no one uses this, then probably nothing. Though, if people think this could be useful:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It would be cool to make easy hooks into any package making web calls to allow users to write data to CouchDB if they choose to, sort of like the example above with rplos.&lt;/li&gt;
&lt;li&gt;Perhaps automate some of the setup for CouchDB for users, making system calls so they don't have to.&lt;/li&gt;
&lt;li&gt;Performance: As shown above, simultaneously writing data to CouchDB takes longer than not doing so - removing this time difference will make writing to couch more palatable.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;What do you think?&lt;/h2&gt;

&lt;p&gt;What is your reaction to this post?  Do you have a need for this sort of tool?  Do you have similar use cases that could be addressed with &lt;code&gt;sofa&lt;/code&gt;?&lt;/p&gt;
</description>
				<published>Mon Jun 17 00:00:00 -0700 2013</published>
				<link>http://schamberlain.github.io/2013/06/couch/</link>
			</item>
		
			<item>
				<title>Fylopic, an R wrapper to Phylopic</title>
				<description>&lt;h2&gt;What is PhyloPic?&lt;/h2&gt;

&lt;p&gt;PhyloPic is an awesome new service - I'll let the creator, &lt;a href=&quot;http://tmkeesey.net/&quot;&gt;Mike Keesey&lt;/a&gt;, explain what it is (paraphrasing here):&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;PhyloPic stores silhouette images of organisms, and each image is associated with taxonomic names, and stores the taxonomy of all taxa, allowing searching by taxonomic names. Anyone can submit silhouettes to PhyloPic.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;What is a silhouette?  It's like this:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://phylopic.org/assets/images/submissions/bedd622a-4de2-4067-8c70-4aa44326d229.128.png&quot; alt=&quot;A silhouette&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;by Gareth Monger&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;What makes PhyloPic not just awesome, but super awesome? All or most images are licensed under &lt;a href=&quot;http://creativecommons.org/&quot;&gt;Creative Commons licenses&lt;/a&gt;. This means you can use the silhouettes without having to ask or pay - just attribute.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2&gt;What is fylopic?&lt;/h2&gt;

&lt;p&gt;The idea behind Fylopic is to create modular bits and pieces (i.e., functions) to allow you to add silhouettes to not only ggplot2 plots, but base plots as well. That is, you can simply load fylopic in your R session, and add some silhouettes to your phylogeny, or your barchart, etc. - that is, &lt;code&gt;fylopic&lt;/code&gt; is meant to be a helper in your workflow to add in silhouettes to visualizations.&lt;/p&gt;

&lt;p&gt;Some people prefer base plots while others prefer ggplot2 plots (me!), so it would be nice to have both options. Phylogenies at the moment render faster in base plots. I don't yet have implementations for base plots, but will come soon, or you can send a pull request to add it.&lt;/p&gt;

&lt;p&gt;One interesting use case could be to be able to get a set of silhouettes, then get a phylogeny for taxa associatd with the silhouettess using the NCBI taxonomy, but it's not easily available yet (though I may be able to use &lt;a href=&quot;https://github.com/bendmorris/phylocommons&quot;&gt;Ben Morris' phylocommons&lt;/a&gt; soon. This isn't doable yet, so in the example below the function &lt;code&gt;make_phylo&lt;/code&gt; creates a phylogeny using &lt;code&gt;ape::rcoal&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You could also do the reverse -&gt; you have a phylogeny and then you could search Phylopic for silhouettes.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2&gt;Info&lt;/h2&gt;

&lt;p&gt;Check out the Phylopic website &lt;a href=&quot;http://phylopic.org/&quot;&gt;here&lt;/a&gt;, and Phylopic API developer documentation &lt;a href=&quot;http://phylopic.org/api/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Also check out Ben Morris' Python wrapper to Phylopic &lt;a href=&quot;https://github.com/bendmorris/python-phylopic&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2&gt;What can you do with fylopic?&lt;/h2&gt;

&lt;hr /&gt;

&lt;h4&gt;Install fylopic&lt;/h4&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;install.packages&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;devtools&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
library&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;devtools&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
install_github&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;fylopic&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;schamberlain&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;library&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;fylopic&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; quietly &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;TRUE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h4&gt;Plot a phylogeny with silhouettes at the tips&lt;/h4&gt;

&lt;p&gt;Here, I search for names based on keyword &lt;em&gt;Homo sapiens&lt;/em&gt; - which returns many matche codes. With those results we search for any silhouettes associated with those codes. Then we download images. Finally, make a phylogeny with the silhouettes at the tips. Note that in this eample the phylogeny is just a random coalescent tree made using &lt;code&gt;ape::rcoal&lt;/code&gt; - obviously, in the real world you'd want to do something more useful.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;## search on Homo sapiens&lt;/span&gt;
searchres &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; search_text&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;text &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;Homo sapiens&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; options &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;names&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;### which returns UUIDs&lt;/span&gt;
searchres&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;[1] &amp;quot;74aea16b-666b-497a-b2cb-72201ad75a8e&amp;quot;
[2] &amp;quot;1ee65cf3-53db-4a52-9960-a9f7093d845d&amp;quot;
[3] &amp;quot;cc9ad8ee-3a82-4add-8d50-bc78f4ff6956&amp;quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;## search for images based on the UUIds&lt;/span&gt;
output &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; search_images&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;uuid &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; searchres&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; options &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; c&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;pngFiles&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;credit&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
    &lt;span class=&quot;s&quot;&gt;&amp;quot;canonicalName&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;### we got eight matches&lt;/span&gt;
output
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;$`15444b9c-f17f-4d6e-89b5-5990096bcfb0`
$`15444b9c-f17f-4d6e-89b5-5990096bcfb0`$supertaxa
[1] &amp;quot;e547cd01-7dd1-495b-8239-52cf9971a609&amp;quot;
[2] &amp;quot;bd88f674-6976-4cb2-a46e-e6a12a8ba463&amp;quot;


$`fedf0e5f-f20a-442c-accf-eb84a3af8c6b`
$`fedf0e5f-f20a-442c-accf-eb84a3af8c6b`$supertaxa
[1] &amp;quot;e547cd01-7dd1-495b-8239-52cf9971a609&amp;quot;
[2] &amp;quot;bd88f674-6976-4cb2-a46e-e6a12a8ba463&amp;quot;


$`a88d3a4c-44d3-409e-87b6-516bd188c709`
$`a88d3a4c-44d3-409e-87b6-516bd188c709`$supertaxa
[1] &amp;quot;e547cd01-7dd1-495b-8239-52cf9971a609&amp;quot;
[2] &amp;quot;bd88f674-6976-4cb2-a46e-e6a12a8ba463&amp;quot;


$`d88164ec-3152-444b-b41c-4757a344a764`
$`d88164ec-3152-444b-b41c-4757a344a764`$supertaxa
[1] &amp;quot;9c6af553-390c-4bdd-baeb-6992cbc540b1&amp;quot;


$`da5eaeb7-1ed2-4b2e-ad4a-49993881d706`
$`da5eaeb7-1ed2-4b2e-ad4a-49993881d706`$supertaxa
[1] &amp;quot;9c6af553-390c-4bdd-baeb-6992cbc540b1&amp;quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;## download images&lt;/span&gt;
myobjs &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; get_image&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;uuids &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; output&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; size &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;128&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;## make the phylogeny&lt;/span&gt;
make_phylo&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;pngobj &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; myobjs&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;img src=&quot;/img/2013-06-01-fylopic/unnamed-chunk-1.png&quot; alt=&quot;center&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h4&gt;Plot a silhouette behind a plot&lt;/h4&gt;

&lt;p&gt;Notice in the below example that you can use normal &lt;code&gt;ggplot2&lt;/code&gt; syntax, and simply add another layer (&lt;code&gt;add_phylopic&lt;/code&gt; from &lt;code&gt;fylopic&lt;/code&gt;) to the plot.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;library&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;ggplot2&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
img &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; get_image&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;27356f15-3cf8-47e8-ab41-71c6260b2724&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; size &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;512&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)[[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]]&lt;/span&gt;
qplot&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;x &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; Sepal.Length&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; y &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; Sepal.Width&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; data &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; iris&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; geom &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;point&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; add_phylopic&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;img&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;img src=&quot;/img/2013-06-01-fylopic/unnamed-chunk-2.png&quot; alt=&quot;center&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h2&gt;What's next?&lt;/h2&gt;

&lt;p&gt;This is a side project, so if anyone has interest in helping please do contribute code, report bugs, request features, etc.&lt;/p&gt;
</description>
				<published>Sat Jun 01 00:00:00 -0700 2013</published>
				<link>http://schamberlain.github.io/2013/06/fylopic/</link>
			</item>
		
			<item>
				<title>BISON USGS species occurrence data</title>
				<description>&lt;p&gt;The USGS recently released a way to search for and get species occurrence records for the USA. The service is called &lt;a href=&quot;http://bison.usgs.ornl.gov/&quot;&gt;BISON&lt;/a&gt; (Biodiversity Information Serving Our Nation). The service has &lt;a href=&quot;http://bison.usgs.ornl.gov/&quot;&gt;a web interface&lt;/a&gt; for human interaction in a browser, and &lt;a href=&quot;http://bison.usgs.ornl.gov/services.html&quot;&gt;two APIs&lt;/a&gt; (application programming interface) to allow machines to interact with their database. One of the APIs allows you to search and retrieve data, and the other gives back maps as either a heatmap or a species occurrence map. The latter is more appropriate for working in a browser, so I'll leave that to the web app folks.&lt;/p&gt;

&lt;p&gt;The Core Science Analytics and Synthesis (CSAS) program of the US Geological Survey are responsible for BISON, and are the US node of the Global Biodiversity Information Facility (GBIF). BISON data is nested within that of GBIF, but has (or wil have?) additional data not in GBIF, as described on their &lt;em&gt;About&lt;/em&gt; page:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;BISON has been initiated with the 110 million records GBIF makes available from the U.S. and is integrating millions more records from other sources each year&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Have a look at their &lt;em&gt;Data providers&lt;/em&gt; and &lt;em&gt;Statistics&lt;/em&gt; tabs on the BISON website, which list where data comes from and how many searches and downloads have been done on each data provider.&lt;/p&gt;

&lt;p&gt;We (rOpenSci) started an R package to interact with the BISON search API &gt;&gt; &lt;code&gt;rbison&lt;/code&gt;. You may be thinking, but if the data in BISON is also in GBIF, why both making another R package for BISON? Good question. As I just said, BISON will have some data GBIF won't have. Also, the services (search API and map service) are different than those of GBIF.&lt;/p&gt;

&lt;p&gt;Check out the package on GitHub here &lt;a href=&quot;https://github.com/ropensci/rbison&quot;&gt;https://github.com/ropensci/rbison&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here is a quick run through of some things you can do with &lt;code&gt;rbison&lt;/code&gt;.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3&gt;Install ribson&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# Install rbison from GitHub using devtools, uncomment to install&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# install.packages(&amp;#39;devtools&amp;#39;) library(devtools) install_github(&amp;#39;rbison&amp;#39;,&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# &amp;#39;ropensci&amp;#39;)&lt;/span&gt;
library&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;rbison&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h3&gt;Search the BISON database for, of course, bison&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# Do the search&lt;/span&gt;
out &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; bison&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;species &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;Bison bison&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; type &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;scientific_name&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; start &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; count &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Check that the returned object is the right class (&amp;#39;bison&amp;#39;)&lt;/span&gt;
class&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;out&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;[1] &amp;quot;bison&amp;quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;h4&gt;Get a summary of the data&lt;/h4&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;bison_data&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;out&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;  total observation fossil specimen unknown
1   761          30      4      709      18
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;h4&gt;Summary by counties (just the first 6 rows)&lt;/h4&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;head&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;bison_data&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;input &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; out&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; datatype &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;counties&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;  record_id total county_name      state
1     48295     7    Lipscomb      Texas
2     41025    15      Harney     Oregon
3     49017     8    Garfield       Utah
4     35031     2    McKinley New Mexico
5     56013     1     Fremont    Wyoming
6     40045     2       Ellis   Oklahoma
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;h4&gt;Summary of states&lt;/h4&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;bison_data&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;input &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; out&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; datatype &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;states&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;      record_id total county_fips
1    Washington     1          53
2         Texas     8          48
3    New Mexico     8          35
4          Iowa     1          19
5       Montana     9          30
6       Wyoming   155          56
7        Oregon    15          41
8      Oklahoma    14          40
9        Kansas    10          20
10      Arizona     1          04
11       Alaska    29          02
12         Utah    16          49
13     Colorado    17          08
14     Nebraska     1          31
15 South Dakota    61          46
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h3&gt;Map the results&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# Search for Ursus americanus (american black bear)&lt;/span&gt;
out &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; bison&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;species &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;Ursus americanus&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; type &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;scientific_name&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; start &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
    count &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Sweet, got some data&lt;/span&gt;
bison_data&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;out&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;  total observation fossil specimen literature unknown centroid
1  3792          59    125     3522         47      39       78
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;h3&gt;Make some maps! Note that right now the county and state maps just plot the conterminous lower 48. The map of individual occurrences shows the lower 48 + Alaska&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# By county&lt;/span&gt;
bisonmap&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;out&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; tomap &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;county&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;img src=&quot;/img/2013-05-25-rbison/map11.png&quot; alt=&quot;center&quot; /&gt;&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# By state&lt;/span&gt;
bisonmap&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;out&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; tomap &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;state&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;img src=&quot;/img/2013-05-25-rbison/map12.png&quot; alt=&quot;center&quot; /&gt;&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# Individual locations&lt;/span&gt;
bisonmap&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;out&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;## Rendering map...plotting 199 points
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;img src=&quot;/img/2013-05-25-rbison/map13.png&quot; alt=&quot;center&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h3&gt;When plotting occurrences, you can pass additional arguments into the &lt;code&gt;bisonmap&lt;/code&gt; function.&lt;/h3&gt;

&lt;h4&gt;For example, you can jitter the points&lt;/h4&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;bisonmap&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;input &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; out&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; geom &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; geom_jitter&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;## Rendering map...plotting 199 points
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;img src=&quot;/img/2013-05-25-rbison/map2.png&quot; alt=&quot;center&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;And you can specify by how much you want the points to jitter (here an extreme example to make it obvious)&lt;/h4&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;library&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;ggplot2&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
bisonmap&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;input &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; out&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; geom &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; geom_jitter&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; jitter &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; position_jitter&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;width &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;## Rendering map...plotting 199 points
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;img src=&quot;/img/2013-05-25-rbison/map3.png&quot; alt=&quot;center&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h4&gt;Let us know if you have any feature requests or find bugs at &lt;a href=&quot;https://github.com/ropensci/rbison/issues&quot;&gt;our GitHub Issues page&lt;/a&gt;.&lt;/h4&gt;
</description>
				<published>Mon May 27 00:00:00 -0700 2013</published>
				<link>http://schamberlain.github.io/2013/05/rbison/</link>
			</item>
		
			<item>
				<title>Scholarly metadata in R</title>
				<description>&lt;p&gt;Scholarly metadata - the meta-information surrounding articles - can be super useful.  Although metadata does not contain the full content of articles, it contains a lot of useful information, including title, authors, abstract, URL to the article, etc.&lt;/p&gt;

&lt;p&gt;One of the largest sources of metadata is provided via the Open Archives Initiative Protocol for Metadata Harvesting or &lt;a href=&quot;http://www.openarchives.org/OAI/openarchivesprotocol.html&quot;&gt;OAI-PMH&lt;/a&gt;. Many publishers, provide their metadata through their own endpoint, and implement the standard OAI-PMH methods: &lt;a href=&quot;http://www.openarchives.org/OAI/openarchivesprotocol.html#GetRecord&quot;&gt;GetRecord&lt;/a&gt;, &lt;a href=&quot;http://www.openarchives.org/OAI/openarchivesprotocol.html#Identify&quot;&gt;Identify&lt;/a&gt;, &lt;a href=&quot;http://www.openarchives.org/OAI/openarchivesprotocol.html#ListIdentifiers&quot;&gt;ListIdentifiers&lt;/a&gt;, &lt;a href=&quot;http://www.openarchives.org/OAI/openarchivesprotocol.html#ListMetadataFormats&quot;&gt;ListMetadataFormats&lt;/a&gt;, &lt;a href=&quot;http://www.openarchives.org/OAI/openarchivesprotocol.html#ListRecords&quot;&gt;ListRecords&lt;/a&gt;, and &lt;a href=&quot;http://www.openarchives.org/OAI/openarchivesprotocol.html#ListSets&quot;&gt;ListSets&lt;/a&gt;. Many providers use OAI-PMH, including &lt;a href=&quot;http://oai.datacite.org/&quot;&gt;DataCite&lt;/a&gt;, &lt;a href=&quot;http://wiki.datadryad.org/Data_Access#OAI-PMH&quot;&gt;Dryad&lt;/a&gt;, and &lt;a href=&quot;http://www.ncbi.nlm.nih.gov/pmc/tools/oai/&quot;&gt;PubMed&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Some data-/article-providers provide their metadata via their own APIs. For example, Nature Publishing Group provides their own metadata API &lt;a href=&quot;http://developers.nature.com/docs&quot;&gt;here&lt;/a&gt; in non OAI-PMH format; you can get PLoS metadata through their &lt;a href=&quot;http://api.plos.org/&quot;&gt;search API&lt;/a&gt;, and the BHL (see below) provides their own custom metadata service.&lt;/p&gt;

&lt;p&gt;In addition, CrossRef provides a number of metadata search services: &lt;a href=&quot;http://search.labs.crossref.org/help/api&quot;&gt;metadata search&lt;/a&gt; and &lt;a href=&quot;http://labs.crossref.org/openurl/&quot;&gt;openurl&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;What about the other publishers? (please tell me if I'm wrong about these three)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Springer has &lt;a href=&quot;http://dev.springer.com/docs&quot;&gt;a metadata API&lt;/a&gt;, but it is terrible, soooo...&lt;/li&gt;
&lt;li&gt;Elsevier, are you kidding? Well, they do have some sort of API service, but its a pain in the ass.&lt;/li&gt;
&lt;li&gt;Wiley, no better than Elsevier.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Note that metadata can live in other places:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Another package being developed by David Springate, &lt;a href=&quot;https://github.com/ropensci/rpubmed&quot;&gt;rpubmed&lt;/a&gt; can get PubMed metadata.&lt;/li&gt;
&lt;li&gt;Our wrapper to the Mendeley API, &lt;a href=&quot;https://github.com/ropensci/rmendeley&quot;&gt;RMendeley&lt;/a&gt;, gets article metadata via Mendeley's database.&lt;/li&gt;
&lt;li&gt;Our wrapper to the Biodiversity Heritage Library API &lt;a href=&quot;http://www.biodiversitylibrary.org/api2/docs/docs.html&quot;&gt;here&lt;/a&gt; gets their metadata.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;No, you can't get metadata via Google Scholar - the don't allow scraping, and don't have expose their data via an API.&lt;/p&gt;

&lt;p&gt;I have discussed this package &lt;a href=&quot;http://schamberlain.github.com/2012/09/rmetadata/&quot;&gt;in a previous blog post&lt;/a&gt;, but have since worked on the code a bit, and thought it deserved a new post.&lt;/p&gt;

&lt;p&gt;You can see a tutorial for this package &lt;a href=&quot;http://ropensci.github.com/rmetadata/&quot;&gt;here&lt;/a&gt;, and contribute to the code &lt;a href=&quot;https://github.com/ropensci/rmetadata&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3&gt;Install rmetadata&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# install_github(&amp;#39;rmetadata&amp;#39;, &amp;#39;ropensci&amp;#39;) # uncomment to install&lt;/span&gt;
library&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;rmetadata&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h3&gt;Count OAI-PMH identifiers for a data provider.&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# For DataCite.&lt;/span&gt;
count_identifiers&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;datacite&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

  provider   count
&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt; datacite &lt;span class=&quot;m&quot;&gt;1216193&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h3&gt;Lookup article info via CrossRef with DOI and get a citation.&lt;/h3&gt;

&lt;h4&gt;As Bibtex&lt;/h4&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;print&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;crossref_citation&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;10.3998/3336451.0009.101&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; style &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;Bibtex&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;Article&lt;span class=&quot;p&quot;&gt;{,&lt;/span&gt;
  title &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;In Google We Trust&lt;span class=&quot;o&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
  author &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;Geoffrey Bilder&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
  journal &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;The Journal of Electronic Publishing&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
  year &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2006&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
  month &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;01&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
  volume &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
  doi &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;10.3998&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;3336451.0009.101&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;h4&gt;As regular text&lt;/h4&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;print&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;crossref_citation&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;10.3998/3336451.0009.101&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; style &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

Bilder G &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2006&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;. &lt;span class=&quot;s&quot;&gt;&amp;quot;In Google We Trust?&amp;quot;&lt;/span&gt; _The Journal of Electronic
Publishing_&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;. &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;URL&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;
http&lt;span class=&quot;o&quot;&gt;://&lt;/span&gt;dx.doi.org&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;10.3998&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;3336451.0009.101&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h3&gt;Search the CrossRef Metatdata for DOIs using free form references.&lt;/h3&gt;

&lt;h4&gt;Search with title, author, year, and journal&lt;/h4&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;crossref_search_free&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;query &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;Piwowar Sharing Detailed Research Data Is Associated with Increased Citation Rate PLOS one 2007&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

                                                                                             text
&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt; Piwowar Sharing Detailed Research Data Is Associated with Increased Citation Rate PLOS one &lt;span class=&quot;m&quot;&gt;2007&lt;/span&gt;
  match                   doi score
&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;  &lt;span class=&quot;kc&quot;&gt;TRUE&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10.1038&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;npre.2007.361 &lt;span class=&quot;m&quot;&gt;4.905&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;h4&gt;Get a DOI and get the citation using \code{crossref_search}&lt;/h4&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# Get a DOI for a paper&lt;/span&gt;
doi &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; crossref_search_free&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;query &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;Piwowar sharing data PLOS one&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;doi

&lt;span class=&quot;c1&quot;&gt;# Get the metadata&lt;/span&gt;
crossref_search&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;doi &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; doi&lt;span class=&quot;p&quot;&gt;)[,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;

                           doi score normalizedScore
&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10.1371&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;journal.pone.0000308 &lt;span class=&quot;m&quot;&gt;18.19&lt;/span&gt;             &lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h3&gt;Get a random set of DOI's through CrossRef.&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# Default search gets 20 random DOIs&lt;/span&gt;
crossref_r&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;

 &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.4028/www.scientific.net/MSF.126-128.467&amp;quot;&lt;/span&gt;
 &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.2139/ssrn.548523&amp;quot;&lt;/span&gt;                       
 &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1016/S0012-821X(02)00562-9&amp;quot;&lt;/span&gt;             
 &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1093/rsq/13.2-3.167&amp;quot;&lt;/span&gt;                    
 &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.5772/55055&amp;quot;&lt;/span&gt;                             
 &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1515/BC.1999.050&amp;quot;&lt;/span&gt;                       
 &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1016/S0020-7292(98)90160-6&amp;quot;&lt;/span&gt;             
 &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1111/j.1439-0418.1985.tb02788.x&amp;quot;&lt;/span&gt;        
 &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1089/aid.2012.0115&amp;quot;&lt;/span&gt;                     
&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1016/0002-9378(95)90155-8&amp;quot;&lt;/span&gt;              
&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;11&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1001/jama.1949.02900490055028&amp;quot;&lt;/span&gt;          
&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1051/jphyscol:1989172&amp;quot;&lt;/span&gt;                  
&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;13&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1016/s0301-2115(03)00298-7&amp;quot;&lt;/span&gt;             
&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;14&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1007/BF02735292&amp;quot;&lt;/span&gt;                        
&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1016/0003-4916(65)90026-6&amp;quot;&lt;/span&gt;              
&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.4156/jdcta.vol5.issue5.12&amp;quot;&lt;/span&gt;              
&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;17&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1007/s10904-009-9316-2&amp;quot;&lt;/span&gt;                 
&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;18&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1023/A:1021690001832&amp;quot;&lt;/span&gt;                   
&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;19&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1007/s12262-012-0724-0&amp;quot;&lt;/span&gt;                 
&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1007/bf02192860&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# Specify you want journal articles only&lt;/span&gt;
crossref_r&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;type &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;journal_article&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

 &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1016/j.jacc.2011.09.055&amp;quot;&lt;/span&gt;                                 
 &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1002/dev.420170603&amp;quot;&lt;/span&gt;                                      
 &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.4315/0362-028X.JFP-10-403&amp;quot;&lt;/span&gt;                               
 &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1016/S0925-4927(98)00016-X&amp;quot;&lt;/span&gt;                              
 &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1111/j.1933-1592.2002.tb00141.x&amp;quot;&lt;/span&gt;                         
 &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1541/ieejfms.127.629&amp;quot;&lt;/span&gt;                                    
 &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.5539/enrr.v3n1p62&amp;quot;&lt;/span&gt;                                       
 &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1016/S0960-9776(96)90038-7&amp;quot;&lt;/span&gt;                              
 &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1016/0925-9635(94)05240-9&amp;quot;&lt;/span&gt;                               
&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1016/s0929-693x(97)86846-7&amp;quot;&lt;/span&gt;                              
&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;11&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1002/(SICI)1096-9071(199601)48:1&amp;lt;53::AID-JMV9&amp;gt;3.0.CO;2-K&amp;quot;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1016/s0267-7261(01)00016-1&amp;quot;&lt;/span&gt;                              
&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;13&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1111/j.1748-0361.2003.tb00575.x&amp;quot;&lt;/span&gt;                         
&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;14&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1097/00005721-197701000-00011&amp;quot;&lt;/span&gt;                           
&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1007/s00894-009-0593-z&amp;quot;&lt;/span&gt;                                  
&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1071/AR9830063&amp;quot;&lt;/span&gt;                                          
&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;17&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1186/gb-2009-10-4-r39&amp;quot;&lt;/span&gt;                                   
&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;18&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.2165/00128415-201113540-00038&amp;quot;&lt;/span&gt;                           
&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;19&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1007/BF00522986&amp;quot;&lt;/span&gt;                                         
&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1080/19407963.2011.539385&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h3&gt;Search the CrossRef Metatdata API.&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# Search for two different query terms&lt;/span&gt;
crossref_search&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;query &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; c&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;renear&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;palmer&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; rows &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)[,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;

                            doi score normalizedScore
&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;       &lt;span class=&quot;m&quot;&gt;10.1126&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;science.1157784 &lt;span class=&quot;m&quot;&gt;3.253&lt;/span&gt;             &lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;
&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;  &lt;span class=&quot;m&quot;&gt;10.1002&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;meet.2009.1450460141 &lt;span class=&quot;m&quot;&gt;2.169&lt;/span&gt;              &lt;span class=&quot;m&quot;&gt;66&lt;/span&gt;
&lt;span class=&quot;m&quot;&gt;3&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10.4242&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;BalisageVol3.Renear01 &lt;span class=&quot;m&quot;&gt;2.102&lt;/span&gt;              &lt;span class=&quot;m&quot;&gt;64&lt;/span&gt;
&lt;span class=&quot;m&quot;&gt;4&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10.4242&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;BalisageVol5.Renear01 &lt;span class=&quot;m&quot;&gt;2.102&lt;/span&gt;              &lt;span class=&quot;m&quot;&gt;64&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# Get results for a certain year&lt;/span&gt;
crossref_search&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;query &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; c&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;renear&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;palmer&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; year &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;2010&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)[,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;

                                  doi  score normalizedScore
&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;            &lt;span class=&quot;m&quot;&gt;10.1002&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;meet.14504701218 &lt;span class=&quot;m&quot;&gt;1.0509&lt;/span&gt;             &lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;
&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;            &lt;span class=&quot;m&quot;&gt;10.1002&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;meet.14504701240 &lt;span class=&quot;m&quot;&gt;1.0509&lt;/span&gt;             &lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;
&lt;span class=&quot;m&quot;&gt;3&lt;/span&gt;           &lt;span class=&quot;m&quot;&gt;10.5270&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;OceanObs09.cwp.68 &lt;span class=&quot;m&quot;&gt;1.0442&lt;/span&gt;              &lt;span class=&quot;m&quot;&gt;99&lt;/span&gt;
&lt;span class=&quot;m&quot;&gt;4&lt;/span&gt;               &lt;span class=&quot;m&quot;&gt;10.1353&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;mpq.2010.0003 &lt;span class=&quot;m&quot;&gt;0.6890&lt;/span&gt;              &lt;span class=&quot;m&quot;&gt;65&lt;/span&gt;
&lt;span class=&quot;m&quot;&gt;5&lt;/span&gt;                  &lt;span class=&quot;m&quot;&gt;10.1353&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;mpq.0.0041 &lt;span class=&quot;m&quot;&gt;0.6890&lt;/span&gt;              &lt;span class=&quot;m&quot;&gt;65&lt;/span&gt;
&lt;span class=&quot;m&quot;&gt;6&lt;/span&gt;                  &lt;span class=&quot;m&quot;&gt;10.1353&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;mpq.0.0044 &lt;span class=&quot;m&quot;&gt;0.6890&lt;/span&gt;              &lt;span class=&quot;m&quot;&gt;65&lt;/span&gt;
&lt;span class=&quot;m&quot;&gt;7&lt;/span&gt;                  &lt;span class=&quot;m&quot;&gt;10.1353&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;mpq.0.0057 &lt;span class=&quot;m&quot;&gt;0.6890&lt;/span&gt;              &lt;span class=&quot;m&quot;&gt;65&lt;/span&gt;
&lt;span class=&quot;m&quot;&gt;8&lt;/span&gt;                    &lt;span class=&quot;m&quot;&gt;10.1386&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;fm.1.1.2 &lt;span class=&quot;m&quot;&gt;0.6890&lt;/span&gt;              &lt;span class=&quot;m&quot;&gt;65&lt;/span&gt;
&lt;span class=&quot;m&quot;&gt;9&lt;/span&gt;                    &lt;span class=&quot;m&quot;&gt;10.1386&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;fm.1.2.2 &lt;span class=&quot;m&quot;&gt;0.6890&lt;/span&gt;              &lt;span class=&quot;m&quot;&gt;65&lt;/span&gt;
&lt;span class=&quot;m&quot;&gt;10&lt;/span&gt;                   &lt;span class=&quot;m&quot;&gt;10.1386&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;fm.1.3.2 &lt;span class=&quot;m&quot;&gt;0.6890&lt;/span&gt;              &lt;span class=&quot;m&quot;&gt;65&lt;/span&gt;
&lt;span class=&quot;m&quot;&gt;11&lt;/span&gt;       &lt;span class=&quot;m&quot;&gt;10.1097&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;ALN.0b013e3181f09404 &lt;span class=&quot;m&quot;&gt;0.6090&lt;/span&gt;              &lt;span class=&quot;m&quot;&gt;57&lt;/span&gt;
&lt;span class=&quot;m&quot;&gt;12&lt;/span&gt;      &lt;span class=&quot;m&quot;&gt;10.1016&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;j.urology.2010.02.033 &lt;span class=&quot;m&quot;&gt;0.6090&lt;/span&gt;              &lt;span class=&quot;m&quot;&gt;57&lt;/span&gt;
&lt;span class=&quot;m&quot;&gt;13&lt;/span&gt;              &lt;span class=&quot;m&quot;&gt;10.1353&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;ect.2010.0025 &lt;span class=&quot;m&quot;&gt;0.6090&lt;/span&gt;              &lt;span class=&quot;m&quot;&gt;57&lt;/span&gt;
&lt;span class=&quot;m&quot;&gt;14&lt;/span&gt;               &lt;span class=&quot;m&quot;&gt;10.1117&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2.4201001.04&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0.6090&lt;/span&gt;              &lt;span class=&quot;m&quot;&gt;57&lt;/span&gt;
&lt;span class=&quot;m&quot;&gt;15&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10.1111&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;j.1835&lt;span class=&quot;m&quot;&gt;-9310.1977&lt;/span&gt;.tb01159.x &lt;span class=&quot;m&quot;&gt;0.6090&lt;/span&gt;              &lt;span class=&quot;m&quot;&gt;57&lt;/span&gt;
&lt;span class=&quot;m&quot;&gt;16&lt;/span&gt;    &lt;span class=&quot;m&quot;&gt;10.4067&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;S0717&lt;span class=&quot;m&quot;&gt;-69962010000100001&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0.6090&lt;/span&gt;              &lt;span class=&quot;m&quot;&gt;57&lt;/span&gt;
&lt;span class=&quot;m&quot;&gt;17&lt;/span&gt;    &lt;span class=&quot;m&quot;&gt;10.4067&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;S0717&lt;span class=&quot;m&quot;&gt;-69962010000200001&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0.6090&lt;/span&gt;              &lt;span class=&quot;m&quot;&gt;57&lt;/span&gt;
&lt;span class=&quot;m&quot;&gt;18&lt;/span&gt;           &lt;span class=&quot;m&quot;&gt;10.2105&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;AJPH.2009.191098 &lt;span class=&quot;m&quot;&gt;0.6029&lt;/span&gt;              &lt;span class=&quot;m&quot;&gt;57&lt;/span&gt;
&lt;span class=&quot;m&quot;&gt;19&lt;/span&gt;              &lt;span class=&quot;m&quot;&gt;10.1353&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;mpq.2010.0004 &lt;span class=&quot;m&quot;&gt;0.5167&lt;/span&gt;              &lt;span class=&quot;m&quot;&gt;49&lt;/span&gt;
&lt;span class=&quot;m&quot;&gt;20&lt;/span&gt;                 &lt;span class=&quot;m&quot;&gt;10.1353&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;mpq.0.0048 &lt;span class=&quot;m&quot;&gt;0.5167&lt;/span&gt;              &lt;span class=&quot;m&quot;&gt;49&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h3&gt;Get a short DOI from shortdoi.org.&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# Geta a short DOI, just the short DOI returned&lt;/span&gt;
short_doi&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;doi &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1371/journal.pone.0042793&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10/f2bfz9&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# Geta a short DOI, all data returned&lt;/span&gt;
short_doi&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;doi &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1371/journal.pone.0042793&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; justshort &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;FALSE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;DOI
&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.1371/journal.pone.0042793&amp;quot;&lt;/span&gt;

&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;ShortDOI
&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10/f2bfz9&amp;quot;&lt;/span&gt;

&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;IsNew
&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;FALSE&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h3&gt;Get a record from a OAI-PMH data provider.&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# Single provider, one identifier&lt;/span&gt;
md_getrecord&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;provider &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;pensoft&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; identifier &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.3897/zookeys.1.10&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

                                                                                                title
&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt; A new candidate &lt;span class=&quot;kr&quot;&gt;for&lt;/span&gt; a Gondwanaland distribution &lt;span class=&quot;kr&quot;&gt;in&lt;/span&gt; the Zodariidae &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;Araneae&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; Australutica &lt;span class=&quot;kr&quot;&gt;in&lt;/span&gt; Africa
      creator date             type
&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt; Jocqué&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;Rudy &lt;span class=&quot;m&quot;&gt;2008&lt;/span&gt; Research Article
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# Single provider, multiple identifiers&lt;/span&gt;
md_getrecord&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;provider &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;pensoft&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; identifier &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; c&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;10.3897/zookeys.1.10&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.3897/zookeys.4.57&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;

                                                                                                   title
&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;    A new candidate &lt;span class=&quot;kr&quot;&gt;for&lt;/span&gt; a Gondwanaland distribution &lt;span class=&quot;kr&quot;&gt;in&lt;/span&gt; the Zodariidae &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;Araneae&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; Australutica &lt;span class=&quot;kr&quot;&gt;in&lt;/span&gt; Africa
&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt; Studies of Tiger Beetles. CLXXVIII. A new Lophyra &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;Lophyra&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; from Somaliland &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;Coleoptera&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; Cicindelidae&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        creator date             type
&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;   Jocqué&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;Rudy &lt;span class=&quot;m&quot;&gt;2008&lt;/span&gt; Research Article
&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt; Cassola&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;Fabio &lt;span class=&quot;m&quot;&gt;2008&lt;/span&gt; Research Article
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h3&gt;List available metadata formats from various providers.&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# List metadata formats for a provider&lt;/span&gt;
md_listmetadataformats&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;provider &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;dryad&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

  metadataPrefix
&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;         oai_dc
&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;            rdf
&lt;span class=&quot;m&quot;&gt;3&lt;/span&gt;            ore
&lt;span class=&quot;m&quot;&gt;4&lt;/span&gt;           mets
                                                       schema
&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;              http&lt;span class=&quot;o&quot;&gt;://&lt;/span&gt;www.openarchives.org&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;OAI&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2.0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;oai_dc.xsd
&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;                 http&lt;span class=&quot;o&quot;&gt;://&lt;/span&gt;www.openarchives.org&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;OAI&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2.0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;rdf.xsd
&lt;span class=&quot;m&quot;&gt;3&lt;/span&gt; http&lt;span class=&quot;o&quot;&gt;://&lt;/span&gt;tweety.lanl.gov&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;public&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;schemas&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2008-06&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;atom&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;tron.sch
&lt;span class=&quot;m&quot;&gt;4&lt;/span&gt;                  http&lt;span class=&quot;o&quot;&gt;://&lt;/span&gt;www.loc.gov&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;standards&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;mets&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;mets.xsd
                            metadataNamespace
&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt; http&lt;span class=&quot;o&quot;&gt;://&lt;/span&gt;www.openarchives.org&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;OAI&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2.0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;oai_dc&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;
&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;    http&lt;span class=&quot;o&quot;&gt;://&lt;/span&gt;www.openarchives.org&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;OAI&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2.0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;rdf&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;
&lt;span class=&quot;m&quot;&gt;3&lt;/span&gt;                 http&lt;span class=&quot;o&quot;&gt;://&lt;/span&gt;www.w3.org&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2005&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;Atom
&lt;span class=&quot;m&quot;&gt;4&lt;/span&gt;                    http&lt;span class=&quot;o&quot;&gt;://&lt;/span&gt;www.loc.gov&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;METS&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# List metadata formats for a specific identifier for a provider&lt;/span&gt;
md_listmetadataformats&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;provider &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;pensoft&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; identifier &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;10.3897/zookeys.1.10&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

            identifier metadataPrefix
&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10.3897&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;zookeys.1.10         oai_dc
&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10.3897&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;zookeys.1.10           mods
                                             schema
&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;    http&lt;span class=&quot;o&quot;&gt;://&lt;/span&gt;www.openarchives.org&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;OAI&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2.0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;oai_dc.xsd
&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt; http&lt;span class=&quot;o&quot;&gt;://&lt;/span&gt;www.loc.gov&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;standards&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;mods&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;v3&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;mods&lt;span class=&quot;m&quot;&gt;-3-1&lt;/span&gt;.xsd
                            metadataNamespace
&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt; http&lt;span class=&quot;o&quot;&gt;://&lt;/span&gt;www.openarchives.org&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;OAI&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2.0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;oai_dc&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;
&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;                  http&lt;span class=&quot;o&quot;&gt;://&lt;/span&gt;www.loc.gov&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;mods&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;v3
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h3&gt;Some plotting - mean number of authors per paper&lt;/h3&gt;

&lt;p&gt;Okay, so this isn't a super useful visualization, but you can surely think of something better.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;library&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;ggplot2&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
library&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;ggthemes&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
library&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;reshape&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;


temp &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; md_listrecords&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;provider &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;pensoft&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; from &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;2011-10-01&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; until &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;2012-01-01&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
temp2 &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; ldply&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;temp&lt;span class=&quot;p&quot;&gt;)[,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;-1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
auths &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; sapply&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;temp2&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;creator&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;x&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; length&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;strsplit&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;as.character&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;x&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; 
    &lt;span class=&quot;s&quot;&gt;&amp;quot;;&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)[[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]]))&lt;/span&gt;
toplot &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; data.frame&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;authors &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; auths&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; articletype &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; temp2&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;type&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
toplot_ &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; ddply&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;toplot&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; .&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;articletype&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; summarise&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; authors &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; mean&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;authors&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
toplot_&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;articletype &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; reorder&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;toplot_&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;articletype&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; toplot_&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;authors&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

ggplot&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;toplot_&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; aes&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;articletype&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; authors&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; theme_tufte&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;base_size &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; geom_bar&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;stat &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;identity&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; 
    coord_flip&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;img src=&quot;/img/someplotting.png&quot; alt=&quot;center&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h4&gt;Get the .Rmd file used to create this post &lt;a href=&quot;https://github.com/SChamberlain/schamberlain.github.com/tree/master/_drafts/2013-03-16-r-metadata.Rmd&quot;&gt;at my github account&lt;/a&gt; - or &lt;a href=&quot;https://github.com/SChamberlain/schamberlain.github.com/tree/master/_posts/2013-03-16-r-metadata.md&quot;&gt;.md file&lt;/a&gt;.&lt;/h4&gt;

&lt;h4&gt;Written in &lt;a href=&quot;http://daringfireball.net/projects/markdown/&quot;&gt;Markdown&lt;/a&gt;, with help from &lt;a href=&quot;http://yihui.name/knitr/&quot;&gt;knitr&lt;/a&gt;, and &lt;a href=&quot;https://github.com/cboettig/knitcitations&quot;&gt;knitcitations&lt;/a&gt;.&lt;/h4&gt;
</description>
				<published>Sat Mar 16 00:00:00 -0700 2013</published>
				<link>http://schamberlain.github.io/2013/03/r-metadata/</link>
			</item>
		
			<item>
				<title>Visualizing rOpenSci collaboration</title>
				<description>&lt;p&gt;We (&lt;a href=&quot;http://ropensci.org/&quot;&gt;rOpenSci&lt;/a&gt;) have been writing code for R packages for a couple years, so it is time to take a look back at the data. What data you ask? The commits data from GitHub ~ data that records who did what and when.&lt;/p&gt;

&lt;p&gt;Using the &lt;a href=&quot;http://developer.github.com/v3/repos/commits/&quot;&gt;Github commits API&lt;/a&gt; we can gather data on who commited code to a Github repository, and when they did it. Then we can visualize this hitorical record.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3&gt;Install some functions for interacting with the Github API via R&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;install_github&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;sandbox&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;ropensci&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; 

library&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;sandbox&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
library&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;httr&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
library&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;ggplot2&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
library&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;scales&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
library&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;reshape2&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
library&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;bipartite&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
library&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;doMC&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
library&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;plyr&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
library&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;ggthemes&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
library&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;picante&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# And authenticate - pops open a page in your default browser, then tells &lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# you authentication was successful&lt;/span&gt;
github_auth&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h3&gt;Get all repos for an organization, here ropensci of course&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;ropensci_repos &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; github_allrepos&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;userorg &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;ropensci&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h3&gt;Get commits broken down in to additions and deletions, though below we just collapse them to all commits&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;registerDoMC&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;cores &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
github_commits_safe &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; plyr&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;failwith&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; github_commits&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
out &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; llply&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;ropensci_repos&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;x&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; github_commits_safe&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;ropensci&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; x&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
    since &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;2009-01-01T&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; limit &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;500&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; .parallel &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;TRUE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
names&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;out&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; ropensci_repos
out2 &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; compact&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;out&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
outdf &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; ldply&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;out2&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h3&gt;Plot commits by date and repo&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;outdf_subset &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; outdf&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;outdf&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;.id &lt;span class=&quot;o&quot;&gt;%in%&lt;/span&gt; c&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;citeulike&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;challenge&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;docs&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;ropensci-book&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
    &lt;span class=&quot;s&quot;&gt;&amp;quot;usecases&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;textmine&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;usgs&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;ropenscitoolkit&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;neotoma&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;rEWDB&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;rgauges&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
    &lt;span class=&quot;s&quot;&gt;&amp;quot;rodash&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;ropensci.github.com&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;ROAuth&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
outdf_subset&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;.id &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; tolower&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;outdf_subset&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;.id&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
outdf_subset &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; ddply&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;outdf_subset&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; .&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;.id&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; date&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; summarise&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; value &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; sum&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;value&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;

mindates &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; llply&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;unique&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;outdf_subset&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;.id&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;x&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; min&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;outdf_subset&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;outdf_subset&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;.id &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; 
    x&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;date&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]))&lt;/span&gt;
names&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;mindates&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; unique&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;outdf_subset&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;.id&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
mindates &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; sort&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;do.call&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;c&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; mindates&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
outdf_subset&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;.id &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; factor&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;outdf_subset&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;.id&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; levels &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; names&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;mindates&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;

ggplot&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;outdf_subset&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; aes&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;date&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; value&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; fill &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; .id&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; 
    geom_bar&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;stat &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;identity&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; width &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0.5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; 
    geom_rangeframe&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;sides &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;b&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; colour &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;grey&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; 
    theme_bw&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;base_size &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; 
    scale_x_date&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;labels &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; date_format&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;%Y&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; breaks &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; date_breaks&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;year&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; 
    scale_y_log10&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; 
    facet_grid&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;.id &lt;span class=&quot;o&quot;&gt;~&lt;/span&gt; .&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; 
    labs&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;x &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; y &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; 
    theme&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;axis.text.y &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; element_blank&lt;span class=&quot;p&quot;&gt;(),&lt;/span&gt; 
        axis.text.x &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; element_text&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;colour &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;black&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; 
        axis.ticks.y &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; element_blank&lt;span class=&quot;p&quot;&gt;(),&lt;/span&gt; 
        strip.text.y &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; element_text&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;angle &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; size &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; 
        strip.background &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; element_rect&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;size &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; 
        panel.grid.major &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; element_blank&lt;span class=&quot;p&quot;&gt;(),&lt;/span&gt; 
        panel.grid.minor &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; element_blank&lt;span class=&quot;p&quot;&gt;(),&lt;/span&gt; 
        legend.text &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; element_text&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;size &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; 
        legend.position &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;none&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
        panel.border &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; element_blank&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;img src=&quot;/img/commitsbydate.png&quot; alt=&quot;center&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The plot above plots the sum of additions+deletions, and is sorted by the first commit date of reach repo, with the first being &lt;a href=&quot;https://github.com/ropensci/treeBASE&quot;&gt;treebase&lt;/a&gt;, which wraps the &lt;a href=&quot;http://treebase.org/treebase-web/urlAPI.html&quot;&gt;Treebase API&lt;/a&gt;, and the most recent being &lt;a href=&quot;https://github.com/ropensci/rWBclimate&quot;&gt;rwbclimate&lt;/a&gt;, which wraps the &lt;a href=&quot;http://data.worldbank.org/developers/climate-data-api&quot;&gt;World Blank climate data API&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can see that some repos have recieved commits more or less consistently over their life time, while others have seen a little development here and there.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;w&lt;/p&gt;

&lt;h3&gt;In addition, there are quite a few people that have committed code now to rOpenSci repos, calling for a network vizualization of course.&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;outdf_network &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; droplevels&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;outdf&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;outdf&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;.id &lt;span class=&quot;o&quot;&gt;%in%&lt;/span&gt; c&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;citeulike&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;challenge&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
    &lt;span class=&quot;s&quot;&gt;&amp;quot;docs&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;ropensci-book&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;usecases&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;textmine&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;usgs&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;ropenscitoolkit&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
    &lt;span class=&quot;s&quot;&gt;&amp;quot;retriever&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;rodash&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;ropensci.github.com&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;ROAuth&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;rgauges&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;sandbox&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
    &lt;span class=&quot;s&quot;&gt;&amp;quot;rfna&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;rmetadata&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;rhindawi&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;rpmc&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;rpensoft&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;ritis&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;
casted &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; dcast&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;outdf_network&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; .id &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; date &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; name &lt;span class=&quot;o&quot;&gt;~&lt;/span&gt; variable&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; fun.aggregate &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; length&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
    value.var &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;value&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
names&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;casted&lt;span class=&quot;p&quot;&gt;)[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;repo&amp;quot;&lt;/span&gt;
casted2 &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; ddply&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;casted&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; .&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;repo&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; name&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; summarise&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; commits &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; sum&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;additions&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
casted2 &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; data.frame&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;repo &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; casted2&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;repo&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; weight &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; casted2&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;commits&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; name &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; casted2&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;name&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
mat &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; sample2matrix&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;casted2&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
plotweb&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;sortweb&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;mat&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; sort.order &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;dec&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; method &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;normal&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; text.rot &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;90&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
    adj.high &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; c&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;-0.3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; adj.low &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; c&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;-0.3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; y.width.low &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0.05&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; y.width.high &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0.05&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
    ybig &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0.09&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; labsize &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0.7&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;img src=&quot;/img/collabnetwork.png&quot; alt=&quot;center&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The plot above shows repos on one side and contributors on the other. Some folks (the core rOpenSci team: cboettig, karthikram, emhart, and schamberlain) have committed quite a lot to many packages. We also have amny awesome contributors to our packages (some contributors and repos have been removed for clarity).&lt;/p&gt;

&lt;p&gt;rOpenSci is truly a collaborative effort to develop tools for open science, so thanks to all our contributors - keep on forking, pull requesting, and commiting.&lt;/p&gt;
</description>
				<published>Fri Mar 08 00:00:00 -0800 2013</published>
				<link>http://schamberlain.github.io/2013/03/ropensci-collaboration/</link>
			</item>
		
			<item>
				<title>Getting a simple tree via NCBI</title>
				<description>&lt;p&gt;I was just at the &lt;a href=&quot;http://www.evoio.org/wiki/Phylotastic&quot;&gt;Phylotastic hackathon&lt;/a&gt; in Tucson, AZ at the &lt;a href=&quot;http://www.iplantcollaborative.org/&quot;&gt;iPlant&lt;/a&gt; facilities at the UofA.&lt;/p&gt;

&lt;p&gt;A problem that needs to be solved is getting the incrasingly vast phylogenetic information to folks not comfortable building their own phylogenies. &lt;a href=&quot;http://phylodiversity.net/phylomatic/&quot;&gt;Phylomatic&lt;/a&gt; has made this super easy for people that want plant phylogenies (at least 250 or so papers have used and cited Phylomatic in their papers) - however, there are few options for those that want phylogenies for other taxonomic groups.&lt;/p&gt;

&lt;p&gt;One cool tool that was brought up was the &lt;a href=&quot;http://www.ncbi.nlm.nih.gov/Taxonomy/CommonTree/wwwcmt.cgi&quot;&gt;Common Tree&lt;/a&gt; service provided by NCBI. &lt;a href=&quot;http://www.ncbi.nlm.nih.gov/Taxonomy/CommonTree/cmthelp.html&quot;&gt;Here's&lt;/a&gt; some help on the service. Unlike Phylomatic, Common Tree is purely based off of taxonomic relationships (A and B are both in the C family, so are sisters), not an actual phylogeny as Phylomatic is based on.&lt;/p&gt;

&lt;p&gt;But how do you use Common Tree?&lt;/p&gt;

&lt;hr /&gt;

&lt;h3&gt;Get a species list&lt;/h3&gt;

&lt;p&gt;Grab the taxon list from my github account &lt;a href=&quot;https://raw.github.com/SChamberlain/schamberlain.github.com/master/img/species.txt&quot;&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Go to the site&lt;/h3&gt;

&lt;p&gt;Go to the Common Tree site &lt;a href=&quot;http://www.ncbi.nlm.nih.gov/Taxonomy/CommonTree/wwwcmt.cgi&quot;&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Choose file&lt;/h3&gt;

&lt;p&gt;Hit the &quot;choose file&quot; button, then select the &lt;code&gt;species.txt&lt;/code&gt; file you downloaded in the first step.&lt;/p&gt;

&lt;h3&gt;Add the species list to make the tree&lt;/h3&gt;

&lt;p&gt;Then hit &quot;add from file&quot;, and you got a &quot;tree&quot;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.github.com/SChamberlain/schamberlain.github.com/master/img/ncbi.png&quot; alt=&quot;image&quot; /&gt;&lt;/p&gt;

&lt;h2&gt;Download&lt;/h2&gt;

&lt;p&gt;You can download the tree in a variety of formats, including a .phy file&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.github.com/SChamberlain/schamberlain.github.com/master/img/ncbi2.png&quot; alt=&quot;image&quot; /&gt;&lt;/p&gt;

&lt;h2&gt;Plot the tree on your machine&lt;/h2&gt;

&lt;p&gt;Make a tree, in R for me&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# install.packages(&amp;#39;ape&amp;#39;) # install if you don&amp;#39;t have ape&lt;/span&gt;
library&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;ape&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Read the tree in. YOu get the tree back with alot of newlines (\n) -&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# can easily take these out with a good text editor.&lt;/span&gt;
tree &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; read.tree&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;text &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;(Lampetra:4,((((((Umbra:4,((Lota:4,Microgadus:4)Gadiformes:4,((Culaea:4,Apeltes:4,Pungitius:4,Gasterosteus:4)Gasterosteidae:4,(Morone:4,(Ambloplites:4,Micropterus:4,Lepomis:4)Centrarchidae:4,(Sander:4,Perca:4)Percidae:4)Percoidei:4,Cottus:4)Percomorpha:4)Holacanthopterygii:4)Neognathi:4,(((Prosopium:4,Coregonus:4)Coregoninae:4,(Salvelinus:4,Salmo:4,Oncorhynchus:4)Salmoninae:4)Salmonidae:4,Osmerus:4)Protacanthopterygii:4)Euteleostei:4,(Alosa:4,(Ameiurus:4,(Catostomus:4,(Semotilus:4,Rhinichthys:4,Margariscus:4,Couesius:4,Pimephales:4,Luxilus:4,Notemigonus:4,Notropis:4,Carassius:4)Cyprinidae:4)Cypriniformes:4)Otophysi:4)Otocephala:4)Clupeocephala:4,Anguilla:4)Elopocephala:4,Acipenser:4)Actinopteri:4,Scyliorhinus:4)Gnathostomata:4)Vertebrata:4;&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# stretch the branches so tips line up&lt;/span&gt;
tree2 &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; compute.brlen&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;tree&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; method &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;Grafen&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Plot the tree&lt;/span&gt;
plot&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;tree2&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; no.margin &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;TRUE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; cex &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0.7&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;h3&gt;w00p, there it is...&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.github.com/SChamberlain/schamberlain.github.com/master/img/ncbi_tree.png&quot; alt=&quot;image4&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h3&gt;And the answer is &lt;em&gt;NO&lt;/em&gt; to the question: Is there an API for Common Tree?&lt;/h3&gt;

&lt;hr /&gt;

&lt;h4&gt;Get the .Rmd file used to create this post &lt;a href=&quot;https://github.com/SChamberlain/schamberlain.github.com/tree/master/_drafts/2013-02-14-common-tree.Rmd&quot;&gt;at my github account&lt;/a&gt; - or &lt;a href=&quot;https://github.com/SChamberlain/schamberlain.github.com/tree/master/_posts/2013-02-14-common-tree.md&quot;&gt;.md file&lt;/a&gt;.&lt;/h4&gt;

&lt;h4&gt;Written in &lt;a href=&quot;http://daringfireball.net/projects/markdown/&quot;&gt;Markdown&lt;/a&gt;, with help from &lt;a href=&quot;http://yihui.name/knitr/&quot;&gt;knitr&lt;/a&gt;.&lt;/h4&gt;
</description>
				<published>Thu Feb 14 00:00:00 -0800 2013</published>
				<link>http://schamberlain.github.io/2013/02/common-tree/</link>
			</item>
		
			<item>
				<title>Waiting for an API request to complete</title>
				<description>&lt;h3&gt;Dealing with API tokens in R&lt;/h3&gt;

&lt;p&gt;In &lt;a href=&quot;http://schamberlain.github.com/2013/01/tnrs-use-case/&quot;&gt;my previous post&lt;/a&gt; I showed an example of calling the Phylotastic taxonomic name resolution API &lt;code&gt;Taxosaurus&lt;/code&gt; &lt;a href=&quot;http://api.phylotastic.org/tnrs&quot;&gt;here&lt;/a&gt;.  When you query their API they give you a token which you use later to retrieve the result (see examples on their page above). However, you don't know when the query will be done, so how do we know when to send the query to rerieve the data?&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;As the time this takes depends on how big the query is and other things, we don't know when we can get the result. I struggled with this for a bit, but then settled on using a while loop.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;So what does this look like?  Basically we just keep sending the request for data until we get it.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;iter &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;  &lt;span class=&quot;c1&quot;&gt;# make an iterator so each time we call&lt;/span&gt;
output &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; list&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;  &lt;span class=&quot;c1&quot;&gt;# make an empty list to put data into&lt;/span&gt;
timeout &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;wait&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kr&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;timeout &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;wait&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    iter &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; iter &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;  &lt;span class=&quot;c1&quot;&gt;# increase the iterator each time&lt;/span&gt;
    temp &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; fromJSON&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;getURL&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;retrieve&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;  &lt;span class=&quot;c1&quot;&gt;# send the request and parse the JSON&lt;/span&gt;
    &lt;span class=&quot;kr&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;grepl&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;is still being processed&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; temp&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;message&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;TRUE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        timeout &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;wait&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        output&lt;span class=&quot;p&quot;&gt;[[&lt;/span&gt;iter&lt;span class=&quot;p&quot;&gt;]]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; temp  &lt;span class=&quot;c1&quot;&gt;# put result from query in the list&lt;/span&gt;
        timeout &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;done&amp;quot;&lt;/span&gt;  &lt;span class=&quot;c1&quot;&gt;# we got the result so timeout is now done, making the while loop stop&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h4&gt;Get the .Rmd file used to create this post &lt;a href=&quot;https://github.com/SChamberlain/schamberlain.github.com/tree/master/_drafts/2013-01-26-api-token.Rmd&quot;&gt;at my github account&lt;/a&gt; - or &lt;a href=&quot;https://github.com/SChamberlain/schamberlain.github.com/tree/master/_posts/2013-01-26-api-token.md&quot;&gt;.md file&lt;/a&gt;.&lt;/h4&gt;

&lt;h4&gt;Written in &lt;a href=&quot;http://daringfireball.net/projects/markdown/&quot;&gt;Markdown&lt;/a&gt;, with help from &lt;a href=&quot;http://yihui.name/knitr/&quot;&gt;knitr&lt;/a&gt;.&lt;/h4&gt;
</description>
				<published>Sat Jan 26 00:00:00 -0800 2013</published>
				<link>http://schamberlain.github.io/2013/01/api-token/</link>
			</item>
		
			<item>
				<title>Resolving species names when you have a lot of them</title>
				<description>&lt;h3&gt;&lt;strong&gt;taxize use case: Resolving species names when you have a lot of them&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;Species names can be a pain in the ass, especially if you are an ecologist. We ecologists aren't trained in taxonomy, yet we often end up with huge species lists.  Of course we want to correct any spelling errors in the names, and get the newest names for our species, resolve any synonyms, etc.&lt;/p&gt;

&lt;p&gt;We are building tools into our R package &lt;a href=&quot;http://ropensci.github.com/taxize_/&quot;&gt;&lt;code&gt;taxize&lt;/code&gt;&lt;/a&gt;, that will let you check your species names to make sure they are correct.&lt;/p&gt;

&lt;p&gt;An important use case is when you have a lot of species. Someone wrote to us recently, saying that they had thousands of species, and they wanted to know how to check their species names efficiently in R.&lt;/p&gt;

&lt;p&gt;Below is an example of how to do this.&lt;/p&gt;

&lt;hr /&gt;

&lt;h4&gt;Install taxize&lt;/h4&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# install_github(&amp;#39;taxize_&amp;#39;, &amp;#39;ropensci&amp;#39;) # install the GitHub version, not&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# the CRAN version, uncomment if you don&amp;#39;t have it installed&lt;/span&gt;
library&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;taxize&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h4&gt;Get some species, in this case all species in the Scrophulariaceae family from theplantlist.org&lt;/h4&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;tpl_get&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;dir_ &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;~/foo2&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; family &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;Scrophulariaceae&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;## Reading and writing csv files to ~/foo2...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;dat &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; read.csv&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;~/foo2/Scrophulariaceae.csv&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h4&gt;Lets grab the species and concatenate to genus_species&lt;/h4&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;species &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; as.character&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;ddply&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;dat&lt;span class=&quot;p&quot;&gt;[,&lt;/span&gt; c&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Genus&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;Species&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)],&lt;/span&gt; .&lt;span class=&quot;p&quot;&gt;(),&lt;/span&gt; transform&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
    gen_sp &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; as.factor&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;paste&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;Genus&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; Species&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; sep &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)))[,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h4&gt;It's better to do many smaller calls to a web API instead of few big ones to be nice to the database maintainers.&lt;/h4&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;## Define function to split up your species list into useable chuncks&lt;/span&gt;
slice &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;input&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; by &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    starts &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; seq&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; length&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;input&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; by&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    tt &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; lapply&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;starts&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;y&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; input&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;y&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;y &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;by &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))])&lt;/span&gt;
    llply&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;tt&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;x&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; x&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;is.na&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;x&lt;span class=&quot;p&quot;&gt;)])&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
species_split &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; slice&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;species&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; by &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h4&gt;Query for your large species list with pauses between calls, with 3 seconds in between calls to not hit the web service too hard. Using POST method here instead of GET - required when you have a lot of species.&lt;/h4&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;tnrs_safe &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; failwith&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; tnrs&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;c1&quot;&gt;# in case some calls fail, will continue&lt;/span&gt;
out &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; llply&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;species_split&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;x&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; tnrs_safe&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;x&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; getpost &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;POST&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; sleep &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;Calling http://taxosaurus.org/retrieve/90fcd9ae425ad7c6103b06dd9fd78ae2
Calling http://taxosaurus.org/retrieve/223f73b83fcddcb8b6187966963660a8
Calling http://taxosaurus.org/retrieve/72bacdbb8938316e321d4c709c8cdd09
Calling http://taxosaurus.org/retrieve/979ce9cc4dec376710f61de162e1294e
Calling http://taxosaurus.org/retrieve/03a39a124561fec2fdfc0f483d9fb607
Calling http://taxosaurus.org/retrieve/d4bf4e5a1403f45a1be1ca3dd87785d7
Calling http://taxosaurus.org/retrieve/a9a9bdde6fda7e325d80120e27ccb480
Calling http://taxosaurus.org/retrieve/215ccdcf2b00362278bf19d1942e1395
Calling http://taxosaurus.org/retrieve/9d43c0b99b4dfb5ea1b435adab17b980
Calling http://taxosaurus.org/retrieve/42e166f8e43f1fb349e36459cd5938b3
Calling http://taxosaurus.org/retrieve/2c42e4b5227c5464f9bfeeafcdf0651d
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# Looks like we got some data back for each element of our species list&lt;/span&gt;
lapply&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;out&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; head&lt;span class=&quot;p&quot;&gt;)[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;  &lt;span class=&quot;c1&quot;&gt;# just look at the first two&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;[[1]]
                 submittedName                 acceptedName    sourceId
1        Aptosimum welwitschii                              iPlant_TNRS
2        Anticharis ebracteata        Anticharis ebracteata iPlant_TNRS
3            Aptosimum lineare            Aptosimum lineare iPlant_TNRS
4     Antherothamnus pearsonii     Antherothamnus pearsonii iPlant_TNRS
5 Barthlottia madagascariensis Barthlottia madagascariensis iPlant_TNRS
6         Agathelpis mucronata                              iPlant_TNRS
  score                  matchedName     annotations
1     1        Aptosimum welwitschii                
2     1        Anticharis ebracteata          Schinz
3     1            Aptosimum lineare Marloth &amp;amp; Engl.
4     1     Antherothamnus pearsonii        N.E. Br.
5     1 Barthlottia madagascariensis      Eb. Fisch.
6     1         Agathelpis mucronata                
                                    uri
1                                      
2 http://www.tropicos.org/Name/29202501
3 http://www.tropicos.org/Name/29202525
4 http://www.tropicos.org/Name/29202728
5 http://www.tropicos.org/Name/50089700
6                                      

[[2]]
                     submittedName           acceptedName    sourceId
1 Buddleja pichinchensis x bullata Buddleja pichinchensis iPlant_TNRS
2                 Buddleja soratae       Buddleja soratae iPlant_TNRS
3              Buddleja euryphylla    Buddleja euryphylla iPlant_TNRS
4                  Buddleja incana        Buddleja incana iPlant_TNRS
5                  Buddleja incana                 Incana        NCBI
6                    Buddleja nana Buddleja brachystachya iPlant_TNRS
  score            matchedName        annotations
1   0.9 Buddleja pichinchensis              Kunth
2   1.0       Buddleja soratae           Kraenzl.
3   1.0    Buddleja euryphylla Standl. &amp;amp; Steyerm.
4   1.0        Buddleja incana        Ruiz &amp;amp; Pav.
5   1.0        Buddleja incana               none
6   1.0          Buddleja nana              Diels
                                          uri
1       http://www.tropicos.org/Name/19000333
2       http://www.tropicos.org/Name/19001018
3       http://www.tropicos.org/Name/19000790
4       http://www.tropicos.org/Name/19000596
5 http://www.ncbi.nlm.nih.gov/taxonomy/405077
6       http://www.tropicos.org/Name/19001133
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# Now we can put them back together as so into one data.frame if you like&lt;/span&gt;
outdf &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; ldply&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;out&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
head&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;outdf&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;                 submittedName                 acceptedName    sourceId
1        Aptosimum welwitschii                              iPlant_TNRS
2        Anticharis ebracteata        Anticharis ebracteata iPlant_TNRS
3            Aptosimum lineare            Aptosimum lineare iPlant_TNRS
4     Antherothamnus pearsonii     Antherothamnus pearsonii iPlant_TNRS
5 Barthlottia madagascariensis Barthlottia madagascariensis iPlant_TNRS
6         Agathelpis mucronata                              iPlant_TNRS
  score                  matchedName     annotations
1     1        Aptosimum welwitschii                
2     1        Anticharis ebracteata          Schinz
3     1            Aptosimum lineare Marloth &amp;amp; Engl.
4     1     Antherothamnus pearsonii        N.E. Br.
5     1 Barthlottia madagascariensis      Eb. Fisch.
6     1         Agathelpis mucronata                
                                    uri
1                                      
2 http://www.tropicos.org/Name/29202501
3 http://www.tropicos.org/Name/29202525
4 http://www.tropicos.org/Name/29202728
5 http://www.tropicos.org/Name/50089700
6
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Note that there are multiple names for some species because data sources have different names for the same species (resulting in more than one row in the data.frame 'outdf' for a species). We are leaving this up to the user to decide which to use. For example, for the species &lt;em&gt;Buddleja montana&lt;/em&gt; there are two names for in the output&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;data &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; ddply&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;outdf&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; .&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;submittedName&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; summarize&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; length&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;submittedName&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
outdf&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;outdf&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;submittedName &lt;span class=&quot;o&quot;&gt;%in%&lt;/span&gt; as.character&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;data&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;data&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;..1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;][&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;submittedName&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]),&lt;/span&gt; 
    &lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;       submittedName     acceptedName    sourceId score      matchedName
123 Buddleja montana Buddleja montana iPlant_TNRS     1 Buddleja montana
124 Buddleja montana          Montana        NCBI     1 Buddleja montana
         annotations                                         uri
123 Britton ex Rusby       http://www.tropicos.org/Name/19000601
124             none http://www.ncbi.nlm.nih.gov/taxonomy/441235
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The source iPlant matched the name, but NCBI actually gave back a genus of cricket (follow the link under the column uri for &lt;em&gt;Montana&lt;/em&gt;). If you look at the page for &lt;em&gt;Buddleja&lt;/em&gt; on NCBI &lt;a href=&quot;http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=26473&quot;&gt;here&lt;/a&gt; there is no &lt;em&gt;Buddleja montana&lt;/em&gt; at all.&lt;/p&gt;

&lt;p&gt;Another thing we could do is look at the score that is returned. Let's look at those that are less than 1 (i.e., )&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;outdf&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;outdf&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;score &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;                        submittedName           acceptedName    sourceId
94   Buddleja pichinchensis x bullata Buddleja pichinchensis iPlant_TNRS
340                Diascia ellaphieae                        iPlant_TNRS
495              Eremophila decipiens                        iPlant_TNRS
500            Eremophila grandiflora             Eremophila iPlant_TNRS
808           Jamesbrittneia hilliard                        iPlant_TNRS
1051                 Verbascum patris              Verbascum iPlant_TNRS
1081             Verbascum barnadesii              Verbascum iPlant_TNRS
1097              Verbascum calycosum              Verbascum iPlant_TNRS
     score            matchedName annotations
94    0.90 Buddleja pichinchensis       Kunth
340   0.98      Diascia ellaphiae            
495   0.98  Eremophila decipiense            
500   0.50             Eremophila      R. Br.
808   0.50         Jamesbrittenia            
1051  0.50              Verbascum          L.
1081  0.50              Verbascum          L.
1097  0.50              Verbascum          L.
                                       uri
94   http://www.tropicos.org/Name/19000333
340                                       
495                                       
500  http://www.tropicos.org/Name/40004761
808                                       
1051 http://www.tropicos.org/Name/40023766
1081 http://www.tropicos.org/Name/40023766
1097 http://www.tropicos.org/Name/40023766
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;As we got this speies list from &lt;a href=&quot;http://www.theplantlist.org/&quot;&gt;theplantlist.org&lt;/a&gt;, there aren't that many mistakes, but if it was my species list you know there would be many :)&lt;/p&gt;

&lt;hr /&gt;

&lt;h3&gt;That's it.  Try it out and let us know if you have any questions at &lt;a href=&quot;mailto:info@ropensci.org&quot;&gt;info@ropensci.org&lt;/a&gt;, or &lt;a href=&quot;https://github.com/ropensci/taxize_/issues&quot;&gt;ask questions/report problems at GitHub&lt;/a&gt;.&lt;/h3&gt;

&lt;hr /&gt;

&lt;h4&gt;Get the .Rmd file used to create this post &lt;a href=&quot;https://github.com/SChamberlain/schamberlain.github.com/tree/master/2013-01-25-tnrs-use-case.Rmd&quot;&gt;at my github account&lt;/a&gt; - or &lt;a href=&quot;https://github.com/SChamberlain/schamberlain.github.com/tree/master/_posts/2013-01-25-tnrs-use-case.md&quot;&gt;.md file&lt;/a&gt;.&lt;/h4&gt;

&lt;h4&gt;Written in &lt;a href=&quot;http://daringfireball.net/projects/markdown/&quot;&gt;Markdown&lt;/a&gt;, with help from &lt;a href=&quot;http://yihui.name/knitr/&quot;&gt;knitr&lt;/a&gt;.&lt;/h4&gt;
</description>
				<published>Fri Jan 25 00:00:00 -0800 2013</published>
				<link>http://schamberlain.github.io/2013/01/tnrs-use-case/</link>
			</item>
		
			<item>
				<title>Open Science Challenge</title>
				<description>&lt;p&gt;&lt;img src=&quot;https://raw.github.com/SChamberlain/schamberlain.github.com/master/img/ropensci_challenge.png&quot; alt=&quot;center&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h3&gt;&lt;strong&gt;Open Science&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;Science is becoming more open in many areas: publishing, data sharing, lab notebooks, and software. There are many benefits to open science. For example, sharing research data alongside your publications leads to increased citation rate (Piwowar &lt;em&gt;et. al.&lt;/em&gt; 2007). In addition, data is becoming easier to share and reuse thanks to efforts like &lt;a href=&quot;http://figshare.com/&quot;&gt;FigShare&lt;/a&gt; and &lt;a href=&quot;http://datadryad.org/&quot;&gt;Dryad&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you don't understand the problem we are currently facing due to lack of open science, watch this video:&lt;/p&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;http://www.youtube.com/embed/N2zK3sAtr-4&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;


&lt;hr /&gt;

&lt;h3&gt;&lt;strong&gt;I just want Data&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;Another way to look at this challenge is to think about how you can get data more easily. Right now you probably go to a website that has an interface to a database. You do a search, and then download a .csv file perhaps. Then you open it in Excel, and do some pivot tables to get the data in the right format. Only then will you bring the data in to R.&lt;/p&gt;

&lt;p&gt;The advantage of using our packages is that they allow you to do that data collection part in a few lines of code. Therefore, you can easily do all those steps in the above paragraph using a few lines of code in one R file. Why does this matter? You can more easily reproduce your own work months later after that summer vacation. In addition, others can reproduce your research more easily.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3&gt;&lt;strong&gt;The challenge&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;We (&lt;a href=&quot;http://ropensci.org/&quot;&gt;ropensci&lt;/a&gt;) have just kicked off the &lt;a href=&quot;http://ropensci.org/open-science-challenge/&quot;&gt;rOpenSci Open Science Challenge&lt;/a&gt;. If you aren't familiar with rOpenSci, it is a software collective connecting scientists to open science data on the web. Since R is the most popular programming language for life scientists, it made sense to do this in R (instead of Python e.g.).&lt;/p&gt;

&lt;hr /&gt;

&lt;h3&gt;&lt;strong&gt;What is the challenge about?&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;At rOpenSci, we create R software to make getting open source text from publications and open source data easy. An important result of this is that we are facilitating open science. Why? Because R is an open source programming language, and all of our software is open source. . This challenge asks you to propose a project using one or more of our packages - or perhaps you want to propose a new dataset to connect to R. The rOpenSci core developer team will help you with any problems using our packages, and attempt to modify packages according to feedback from participants. Do you use one or more of our R packages? If you do, great. If not, check out our packages &lt;a href=&quot;http://ropensci.org/packages/index.html&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3&gt;&lt;strong&gt;How to apply&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;Just send an email to &lt;a href=&quot;mailto:info@ropensci.org?subject=rOpenSci%20Open%20Science%20Challenge&quot;&gt;info@ropensci.org&lt;/a&gt;.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3&gt;&lt;strong&gt;The deadline&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;January 31, 2013&lt;/p&gt;

&lt;hr /&gt;

&lt;h4&gt;Get the .Rmd file used to create this post &lt;a href=&quot;https://github.com/SChamberlain/schamberlain.github.com/tree/master/_drafts/2013-01-08-open-science-challenge.Rmd&quot;&gt;at my github account&lt;/a&gt; - or &lt;a href=&quot;https://github.com/SChamberlain/schamberlain.github.com/tree/master/_posts/2013-01-08-open-science-challenge.md&quot;&gt;.md file&lt;/a&gt;.&lt;/h4&gt;

&lt;h4&gt;Written in &lt;a href=&quot;http://daringfireball.net/projects/markdown/&quot;&gt;Markdown&lt;/a&gt;, with help from &lt;a href=&quot;http://yihui.name/knitr/&quot;&gt;knitr&lt;/a&gt;, and &lt;a href=&quot;https://github.com/cboettig/knitcitations&quot;&gt;knitcitations&lt;/a&gt; from &lt;a href=&quot;http://www.carlboettiger.info/&quot;&gt;Carl Boettiger&lt;/a&gt;.&lt;/h4&gt;

&lt;hr /&gt;

&lt;h4&gt;References&lt;/h4&gt;

&lt;p&gt;Piwowar HA, Day RS, Fridsma DB and Ioannidis J (2007).
&amp;ldquo;Sharing Detailed Research Data is Associated With Increased Citation Rate.&amp;rdquo;
&lt;EM&gt;Plos One&lt;/EM&gt;, &lt;B&gt;2&lt;/B&gt;.
&lt;a href=&quot;http://dx.doi.org/10.1371/journal.pone.0000308&quot;&gt;http://dx.doi.org/10.1371/journal.pone.0000308&lt;/a&gt;.

</description>
				<published>Tue Jan 08 00:00:00 -0800 2013</published>
				<link>http://schamberlain.github.io/2013/01/open-science-challenge/</link>
			</item>
		
			<item>
				<title>Is invasive?</title>
				<description>&lt;p&gt;The Global Invasive Species Database (GISD) (see their website for more info &lt;a href=&quot;http://www.issg.org/database/welcome/&quot;&gt;here&lt;/a&gt;) has data on the invasiveness status of many species. From &lt;code&gt;taxize&lt;/code&gt; you can now query the GISD database.&lt;/p&gt;

&lt;p&gt;Introducing the function &lt;code&gt;gisd_isinvasive&lt;/code&gt;. This function was contributed to &lt;code&gt;taxize&lt;/code&gt; by &lt;a href=&quot;http://www.bartomeus.cat/es/ignasi/&quot;&gt;Ignasi Bartomeus&lt;/a&gt;, a postdoc at the Swedish University Agricultural Sciences.&lt;/p&gt;

&lt;p&gt;There are two possible outputs from using &lt;code&gt;gisd_isinvasive&lt;/code&gt;: &quot;Invasive&quot; or &quot;Not in GISD&quot;. If you use &lt;code&gt;simplify=TRUE&lt;/code&gt; in the function you get &quot;Invasive&quot; or &quot;Not in GISD&quot;, but if you use &lt;code&gt;simplify=FALSE&lt;/code&gt; you get verbose description of the invasive species instead of just &quot;Invasive&quot; (and you still just get &quot;Not in GISD&quot;).&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;img src=&quot;http://schamberlain.github.com/img/gisd_small.png&quot; alt=&quot;center&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h3&gt;Install taxize from GitHub&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# install_github(&amp;#39;taxize_&amp;#39;, &amp;#39;ropensci&amp;#39;) # install if you don&amp;#39;t already&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# have the GitHub version&lt;/span&gt;
library&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;taxize&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h3&gt;Make a vector of species&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;sp &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; c&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Carpobrotus edulis&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;Rosmarinus officinalis&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;Nasua nasua&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;Martes melampus&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
    &lt;span class=&quot;s&quot;&gt;&amp;quot;Centaurea solstitialis&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;h3&gt;Using the function &lt;code&gt;gisd_isinvasive&lt;/code&gt; you can query the GISD database for the invasiveness status of your species, at least according to GISD. Calling &lt;code&gt;gisd_isinvasive&lt;/code&gt; with the second parameter set to default &lt;code&gt;simplify=FALSE&lt;/code&gt;, you get verbose output, with details on the species.&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;gisd_isinvasive&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;sp&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;Checking species 1
Checking species 2
Checking species 3
Checking species 4
Checking species 5
Done

                 species
1     Carpobrotus edulis
2 Rosmarinus officinalis
3            Nasua nasua
4        Martes melampus
5 Centaurea solstitialis
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               status
1                                                                                                                                                                                                                                                  You searched for invasive species named Carpobrotus edulis:     1.  Carpobrotus edulis (succulent)        Carpobrotus edulis is a mat-forming succulent native to South Africa which is invasive primarily in coastal habitats in many parts of the world. It was often introduced as an ornamental plant or used for planting along roadsides, from which it has spread to become invasive. Its main impacts are smothering, reduced regeneration of native flora and changes to soil pH and nutrient regimes.\r\nCommon Names: balsamo, Cape fig, figue marine, freeway iceplant, ghaukum, ghoenavy, highway ice plant, higo del Cabo, higo marino, Hottentosvy, hottentot fig, Hottentottenfeige, iceplant, ikhambi-lamabulawo, Kaapsevy, patata frita, perdevy, pigface, rankvy, sea fig, sour fig, suurvy, umgongozi, vyerank\r\nSynonyms: Mesembryanthemum edule L., Mesembryanthemum edulis
2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         Not in GISD
3                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            You searched for invasive species named Nasua nasua:1.  Nasua nasua (mammal)             Interim profile, incomplete informationCommon Names: Achuni, Coatí, South American Coati, Tejón
4                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       You searched for invasive species named Martes melampus:1.  Martes melampus (mammal)             Interim profile, incomplete informationCommon Names: Japanese Marten, Tsushima Island Marten
5 You searched for invasive species named Centaurea solstitialis:     1.  Centaurea solstitialis (herb)        Centaurea solstitialis is a winter annual that can form dense impenetrable stands that displace desirable vegetation in natural areas, rangelands, and other places. It is best adapted to open grasslands with deep, well-drained soils and an annual precipitation range of 25 to 150cm per year. It is intolerant of shade. Although populations can occur at elevations as high as 2,400 m, most large infestations are found below 1,500 m. Human activities are the primary mechanisms for the long distance movement of C. solstitialis seed. The short, stiff, pappus bristles are covered with barbs that readily adhere to clothing, hair, and fur.  The movement of contaminated hay and uncertified seed are also important long distance transportation mechanisms. Wind disperses seeds over short distances.\r\nCommon Names: geeldissel, golden star thistle, sonnwend-Flockenblume, St. Barnaby&amp;#39;s thistle, yellow centaury, yellow cockspur, yellow star thistle\r\nSynonyms: Leucantha solstitialis (L.) A.&amp;amp; D. Löve
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;h3&gt;Simpler output, just the invasive status.&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;r&quot;&gt;gisd_isinvasive&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;sp&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; simplify &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;TRUE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;Checking species 1
Checking species 2
Checking species 3
Checking species 4
Checking species 5
Done

                 species      status
1     Carpobrotus edulis    Invasive
2 Rosmarinus officinalis Not in GISD
3            Nasua nasua    Invasive
4        Martes melampus    Invasive
5 Centaurea solstitialis    Invasive
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;hr /&gt;

&lt;h4&gt;Get the .Rmd file used to create this post &lt;a href=&quot;https://github.com/SChamberlain/schamberlain.github.com/tree/master/_drafts/2012-12-13-is-invasive.Rmd&quot;&gt;at my github account&lt;/a&gt; - or &lt;a href=&quot;https://github.com/SChamberlain/schamberlain.github.com/tree/master/_posts/2012-12-13-is-invasive.md&quot;&gt;.md file&lt;/a&gt;.&lt;/h4&gt;

&lt;h4&gt;Written in &lt;a href=&quot;http://daringfireball.net/projects/markdown/&quot;&gt;Markdown&lt;/a&gt;, with help from &lt;a href=&quot;http://yihui.name/knitr/&quot;&gt;knitr&lt;/a&gt;.&lt;/h4&gt;
</description>
				<published>Thu Dec 13 00:00:00 -0800 2012</published>
				<link>http://schamberlain.github.io/2012/12/is-invasive/</link>
			</item>
		
	</channel>
</rss>