Skip to content

Instantly share code, notes, and snippets.

@sckott
sckott / server.r
Last active August 29, 2015 14:00
library("shiny")
library("plotly")
library("ggplot2")
shinyServer(function(input, output) {
output$text <- renderText({
ggiris <- qplot(Petal.Width, Sepal.Length, data=iris, color=Species)
py <- plotly("RgraphingAPI", "ektgzomjbx")
res <- py$ggplotly(ggiris)
iframe <- paste("<iframe height=\"600\" id=\"igraph\" scrolling=\"no\" seamless=\"seamless\" src=\"",
@sckott
sckott / rnoaa_eg.html
Created April 18, 2014 14:11
rnoaa example
<p>Here's an example workflow that should work for you.</p>
<p>Note that you can alternatively install the development version of <code>rnoaa</code> from Github by doing</p>
<pre class="sourceCode r"><code class="sourceCode r"><span class="kw">install.packages</span>(<span class="st">&quot;devtools&quot;</span>)
<span class="kw">library</span>(<span class="st">&quot;devtools&quot;</span>)
<span class="kw">install_github</span>(<span class="st">&quot;ropensci/rnoaa&quot;</span>)</code></pre>
<h3 id="load-rnoaa">Load rnoaa</h3>
<pre class="sourceCode r"><code class="sourceCode r"><span class="kw">library</span>(<span class="st">&quot;rnoaa&quot;</span>)</code></pre>
<h3 id="seach-for-stations-at-zip-28801">Seach for stations at zip 28801</h3>
<pre class="sourceCode r"><code class="sourceCode r">stations &lt;-<span class="st"> </span><span class="kw">noaa_stations</span>(<span class="dt">locationid =</span> <span class="st">&quot;ZIP:28801&quot;</span>)</code></pre>
<h3 id="these-are-stations-avoilable-at-that-l
@sckott
sckott / rnoaa_eg.md
Last active August 29, 2015 14:00
Example using rnoaa

Here's an example workflow for rnoaa.

Note that you can alternatively install the development version of rnoaa from Github by doing

install.packages("devtools")
library("devtools")
install_github("ropensci/rnoaa")

Install from CRAN and load

install.packages("solr")
library("solr")

Define URL

@sckott
sckott / plos_solr_search.md
Created April 22, 2014 16:23
PLOS API solr search using solr R pkg

Install from CRAN and load

install.packages("solr")
library("solr")

Define URL

@sckott
sckott / my.geojson
Created April 23, 2014 15:48
Occurrences of three bird species mapped
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

You're ruining the internet

Dear Mr. Wheeler,

You're ruining the internet. I'm not dumb - I understand hwhy you would create "fast lanes" - the revolving door has let you in to the FCC - and you want to give handouts to your buddies in the television industry. Makes sense.

But of course you should be doing what's best for the public - not what's best for Comcast and Time Warner Cable. Don't you think they're filthy rich enough already?

You know that by creating these fast lanes smaller companies that can't afford to pay the "toll" won't be able to compete - thus you'll be helping big companies get bigger, and small companies go out of business.

@sckott
sckott / spp_occ_eg.md
Last active August 29, 2015 14:00
Example of getting species occurrence data:

Install the development version

install.packages("devtools")
library("devtools")
install_github("ropensci/taxize")

Using RMendeley

Authenticating with Mendeley

With the OAuth methods in the new RMendeley (dev branch on the GitHub repository), it is now possible to manage one's entire library directly from the R console. After installing (see development version tab) both ROAuth and RMendeley, follow the tutorial below to query Mendeley, manage documents and groups.