Recology

R/etc.

sofa - reboot

I've reworked sofa recently after someone reported a bug in the package. Since the last post on this package on 2013-06-21, there's a bunch of changes:

  • Removed the sofa_ prefix from all functions as it wasn't really necessary.
  • Replaced rjson/RJSONIO with jsonlite for JSON I/O.
  • New functions:
    • revisions() - to get the revision numbers for a document.
    • uuids() - get any number of UUIDs - e.g., if you want to set document IDs with UUIDs
  • Most functions that deal with documents are prefixed with doc_
  • Functions that deal with databases are prefixed with db_
  • Simplified all code, reducing duplication
  • All functions take cushion as the first parameter, for consistency sake.
  • Changed cushion() function so that you can only register one cushion with each function call, and the function takes parameters for each element now, name (name of the cushion, whatever you want), user (user name, if applicable), pwd (password, if applicable), type (one of localhost, cloudant, or iriscouch), and port (if applicable).
  • Changed package license from CC0 to MIT

There's still more to do, but I'm pretty happy with the recent changes, and I hope at least some find the package useful. Also, would love people to try it out as all bugs are shallow and all that...

The following are a few examples of package use.

Install CouchDB

Instructions here

Start CouchDB

In your terminal

couchdb

You can interact with your CouchDB databases as well in your browser. Navigate to http://localhost:5984/_utils

Install sofa

install.packages("devtools")
devtools::install_github("sckott/sofa")
library('sofa')

Authenticate - Cushions

As an example, here's how I set up details for connecting to my Cloudant couch:

cushion(name = 'cloudant', user = '<user name>', pwd = '<password>', type = "cloudant")

By default there is a built-in cushion for localhost so you don't have to do that, unless you want to change those details, e.g., the port number. Right now cushions aren't preserved across R sessions, but working on that.

For example, I'll lay down a cushion for Cloudant, then I can call cushions() to see my cushions:

cushion(name = 'cloudant', user = '<user name>', pwd = '<pwd>', type = "cloudant")
cushions()

By default, if you don't provide a cushion name, you are using localhost.

Ping the server

ping()
#> $couchdb
#> [1] "Welcome"
#> 
#> $uuid
#> [1] "2c10f0c6d9bd17205b692ae93cd4cf1d"
#> 
#> $version
#> [1] "1.6.0"
#> 
#> $vendor
#> $vendor$version
#> [1] "1.6.0-1"
#> 
#> $vendor$name
#> [1] "Homebrew"

Nice, it's working.

Create a new database, and list available databases

db_create(dbname='sofadb')
#> $ok
#> [1] TRUE

see if its there now

db_list()
#>  [1] "_replicator" "_users"      "alm_couchdb" "cachecall"   "hello_earth"
#>  [6] "leothelion"  "mran"        "mydb"        "newdbs"      "sofadb"

Create documents

Create a document WITH a name (uses PUT)

doc1 <- '{"name":"sofa","beer":"IPA"}'
doc_create(dbname="sofadb", doc=doc1, docid="a_beer")
#> $ok
#> [1] TRUE
#> 
#> $id
#> [1] "a_beer"
#> 
#> $rev
#> [1] "1-a48c98c945bcc05d482bc6f938c89882"

Create a document WITHOUT a name (uses POST)

doc2 <- '{"name":"sofa","icecream":"rocky road"}'
doc_create(dbname="sofadb", doc=doc2)
#> $ok
#> [1] TRUE
#> 
#> $id
#> [1] "c5c5c332c25cf62cc584647a81006f6d"
#> 
#> $rev
#> [1] "1-fd0da7fcb8d3afbfc5757d065c92362c"

List documents

List them

alldocs(dbname="sofadb")
#>                                 id                              key
#> 1                           a_beer                           a_beer
#> 2 c5c5c332c25cf62cc584647a81006f6d c5c5c332c25cf62cc584647a81006f6d
#>                                  rev
#> 1 1-a48c98c945bcc05d482bc6f938c89882
#> 2 1-fd0da7fcb8d3afbfc5757d065c92362c

Optionally include the documents, returned as a list by default as it would be hard to parse an endless number of document formats.

alldocs(dbname="sofadb", include_docs = TRUE)
#> $total_rows
#> [1] 2
#> 
#> $offset
#> [1] 0
#> 
#> $rows
#> $rows[[1]]
#> $rows[[1]]$id
#> [1] "a_beer"
#> 
#> $rows[[1]]$key
#> [1] "a_beer"
#> 
#> $rows[[1]]$value
#> $rows[[1]]$value$rev
#> [1] "1-a48c98c945bcc05d482bc6f938c89882"
#> 
#> 
#> $rows[[1]]$doc
#> $rows[[1]]$doc$`_id`
#> [1] "a_beer"
#> 
#> $rows[[1]]$doc$`_rev`
#> [1] "1-a48c98c945bcc05d482bc6f938c89882"
#> 
#> $rows[[1]]$doc$name
#> [1] "sofa"
#> 
#> $rows[[1]]$doc$beer
#> [1] "IPA"
#> 
#> 
#> 
#> $rows[[2]]
#> $rows[[2]]$id
#> [1] "c5c5c332c25cf62cc584647a81006f6d"
#> 
#> $rows[[2]]$key
#> [1] "c5c5c332c25cf62cc584647a81006f6d"
#> 
#> $rows[[2]]$value
#> $rows[[2]]$value$rev
#> [1] "1-fd0da7fcb8d3afbfc5757d065c92362c"
#> 
#> 
#> $rows[[2]]$doc
#> $rows[[2]]$doc$`_id`
#> [1] "c5c5c332c25cf62cc584647a81006f6d"
#> 
#> $rows[[2]]$doc$`_rev`
#> [1] "1-fd0da7fcb8d3afbfc5757d065c92362c"
#> 
#> $rows[[2]]$doc$name
#> [1] "sofa"
#> 
#> $rows[[2]]$doc$icecream
#> [1] "rocky road"

Update a document

Change IPA (india pale ale) to IPL (india pale lager). We need to get revisions first as we need to include revision number when we update a document.

(revs <- revisions(dbname = "sofadb", docid = "a_beer"))
#> [1] "1-a48c98c945bcc05d482bc6f938c89882"
newdoc <- '{"name":"sofa","beer":"IPL"}'
doc_update(dbname = "sofadb", doc = newdoc, docid = "a_beer", rev = revs[1])
#> $ok
#> [1] TRUE
#> 
#> $id
#> [1] "a_beer"
#> 
#> $rev
#> [1] "2-f2390eb18b8f9a870c915c6712a7f65e"

Should be two revisions now

revisions(dbname = "sofadb", docid = "a_beer")
#> [1] "2-f2390eb18b8f9a870c915c6712a7f65e"
#> [2] "1-a48c98c945bcc05d482bc6f938c89882"

Get headers for a document

doc_head(dbname = "sofadb", docid = "a_beer")
#> [[1]]
#> [[1]]$status
#> [1] 200
#> 
#> [[1]]$version
#> [1] "HTTP/1.1"
#> 
#> [[1]]$headers
#> $server
#> [1] "CouchDB/1.6.0 (Erlang OTP/17)"
#> 
#> $etag
#> [1] "\"2-f2390eb18b8f9a870c915c6712a7f65e\""
#> 
#> $date
#> [1] "Tue, 18 Nov 2014 21:19:16 GMT"
#> 
#> $`content-type`
#> [1] "application/json"
#> 
#> $`content-length`
#> [1] "88"
#> 
#> $`cache-control`
#> [1] "must-revalidate"
#> 
#> attr(,"class")
#> [1] "insensitive" "list"

JSON vs. list

Across all/most functions you can request json or list as output with the as parameter.

db_list(as = "list")
#>  [1] "_replicator" "_users"      "alm_couchdb" "cachecall"   "hello_earth"
#>  [6] "leothelion"  "mran"        "mydb"        "newdbs"      "sofadb"
db_list(as = "json")
#> [1] "[\"_replicator\",\"_users\",\"alm_couchdb\",\"cachecall\",\"hello_earth\",\"leothelion\",\"mran\",\"mydb\",\"newdbs\",\"sofadb\"]\n"

Curl options

Across all functions you can pass in curl options. We're using httr internally, so you can use httr helper functions to make some curl options easier. Examples:

Verbose output

library("httr")
db_list(config=verbose())
#>  [1] "_replicator" "_users"      "alm_couchdb" "cachecall"   "hello_earth"
#>  [6] "leothelion"  "mran"        "mydb"        "newdbs"      "sofadb"

Progress

db_list(config=progress())
#>   |                                                                         |                                                                 |   0%  |                                                                         |=================================================================| 100%
#>  [1] "_replicator" "_users"      "alm_couchdb" "cachecall"   "hello_earth"
#>  [6] "leothelion"  "mran"        "mydb"        "newdbs"      "sofadb"

Set a timeout

db_list(config=timeout(seconds = 0.001))
#> 
#> Error in function (type, msg, asError = TRUE)  : 
#>    Operation timed out after 3 milliseconds with 0 out of -1 bytes received

Full text search

I'm working on an R client for Elaticsearch called elastic - find it at https://github.com/ropensci/elastic

Thinking about where to include functions to allow elastic and sofa to work together...if you have any thoughts hit up the issues. I'll probably include helper functions for CouchDB search in the elastic package, interfacing with the CouchDB plugin for Elasticsearch.

Conditionality meta-analysis data

The paper

One paper from my graduate work asked most generally ~ "How much does the variation in magnitudes and signs of species interaction outcomes vary?". More specifically, we wanted to know if variation differed among species interaction classes (mutualism, competition, predation), and among various "gradients" (space, time, etc.). To answer this question, we used a meta-analysis approach (rather than e.g., a field experiment). We published the paper recently.

p.s. I really really wish we would have put it in an open access journal...

The data

Anyway, I'm here to talk about the data. We didn't get the data up with the paper, but it is up on Figshare now. The files there are the following:

  • coniditionality.R - script used to process the data from variables_prelim.csv
  • variables_prelim.csv - description of variables in the preliminary data set, matches conditionality_data_prelim.csv
  • variables_used.csv - description of variables in the used data set, matches conditionality_data_used.csv
  • conditionality_data_prelim.csv - preliminary data, the raw data
  • conditionality_data_used.csv - the data used for our paper
  • README.md - the readme
  • paper_selection.csv - the list of papers we went through, with remarks about paper selection

Please do play with the data, publish some papers, etc, etc. It took 6 of us about 4 years to collect this data; we skimmed through ~11,000 papers on the first pass (aka. skimming through abstracts in Google Scholar and Web of Science), then decided on nearly 500 papers to get data from, and narrowed down to 247 papers for the publication mentioned above. Now, there was no funding for this, so it was sort of done in between other projects, but still, it was simply A LOT of tables to digitize, and graphs to extract data points from. Anyway, hopefully you will find this data useful :p

EML

I think this dataset would be a great introduction to the potential power of EML (Ecological Metadata Langauge). At rOpenSci, one of our team Carl Boettiger, along with Claas-Thido Pfaff, Duncan Temple Lang, Karthik Ram, and Matt Jones, have created an R client for EML, to parse EML files and to create and publish them.

What is EML?/Why EML?

A demonstration is in order...

Example using EML with this dataset

Install EML

library("devtools")
install.packages("RHTMLForms", repos = "http://www.omegahat.org/R/", type="source")
install_github("ropensci/EML", build=FALSE, dependencies=c("DEPENDS", "IMPORTS"))

Load EML

library('EML')

Prepare metadata

# dataset
prelim_dat <- read.csv("conditionality_data_prelim.csv")
# variable descriptions for each column
prelim_vars <- read.csv("variables_prelim.csv", stringsAsFactors = FALSE)

Get column definitions in a vector

col_defs <- prelim_vars$description

Create unit definitions for each column

unit_defs <- list(
  c(unit = "number",
    bounds = c(0, Inf)),
  c(unit = "number",
    bounds = c(0, Inf)),
  "independent replicates",
  c(unit = "number",
    bounds = c(0, Inf)),

  ... <CUTOFF>
)

Write an EML file

eml_write(prelim_dat,
          unit.defs = unit_defs,
          col.defs = col_defs,
          creator = "Scott Chamberlain",
          contact = "myrmecocystus@gmail.com",
          file = "conditionality_data_prelim_eml.xml")
## [1] "conditionality_data_prelim_eml.xml"

Validate the EML file

eml_validate("conditionality_data_prelim_eml.xml")
## EML specific tests XML specific tests 
##               TRUE               TRUE

Read data and metadata

gg <- eml_read("conditionality_data_prelim_eml.xml")
eml_get(gg, "contact")
## [1] "myrmecocystus@gmail.com"
eml_get(gg, "citation_info")
## Chamberlain S (2014-10-06). _metadata_.
dat <- eml_get(gg, "data.frame")
head(dat[,c(1:10)])
##   order i indrep avg author_last  finit_1 finit_2 finit_abv co_author
## 1     1 1      a   1      Devall margaret       s        ms     Thein
## 2     2 1      a   2      Devall margaret       s        ms     Thein
## 3     3 1      a   3      Devall margaret       s        ms     Thein
## 4     4 1      a   4      Devall margaret       s        ms     Thein
## 5     5 1      a   5      Devall margaret       s        ms     Thein
## 6     6 1      a   6      Devall margaret       s        ms     Thein
##   sinit_1
## 1 leonard
## 2 leonard
## 3 leonard
## 4 leonard
## 5 leonard
## 6 leonard

Publish

We can also use the EML package to publish the data, here to Figshare.

First, install rfigshare

install.packages("rfigshare")
library('rfigshare')

Then publish using eml_publish()

figid <- eml_publish(
            file = "conditionality_data_prelim_eml.xml",
            description = "EML file for Chamberlain, S.A., J.A. Rudgers, and J.L. Bronstein. 2014. How context-dependent are species interactions. Ecology Letters",
            categories = "Ecology",
            tags = "EML",
            destination = "figshare",
            visibility = "public",
            title = "condionality data, EML")
fs_make_public(figid)

rsunlight - R client for Sunlight Labs APIs

My last blog post on this package was so long ago the package wrapped both New York Times APIs and Sunlight Labs APIs and the package was called govdat. I split that package up into rsunlight for Sunlight Labs APIs and rtimes for some New York Times APIs. rtimes is in development at Github.

We've updated the package to include four sets of functions, one set for each of four Sunlight Labs APIs (with a separate prefix for each API):

  • Congress API (cg_)
  • Open States API (os_)
  • Capitol Words API (cw_)
  • Influence Explorer API (ie_)

Then there are many methods for each API.

rsunlight intro

Installation

First, installation

devtools::install_github("ropengov/rsunlight")

Load the library

library("rsunlight")

Congress API

Search for Fed level bills that include the term health care in them.

res <- cg_bills(query='health care')
head(res$results[,1:4])
##          nicknames congress last_version_on sponsor_id
## 1        obamacare      111      2010-08-25    S000749
## 2 obamacare, ppaca      111      2010-08-25    R000053
## 3             NULL      113      2013-10-09    K000220
## 4             NULL      111      2009-01-06    I000056
## 5             NULL      112      2011-01-05    I000056
## 6             NULL      111      2009-05-05    D000197

Search for bills that have the two terms transparency and accountability within 5 words of each other in the bill.

res <- cg_bills(query='transparency accountability'~5)
head(res$results[,1:4])
##   congress last_version_on sponsor_id
## 1      111      2009-01-15    R000435
## 2      113      2013-07-17    R000595
## 3      112      2011-12-08    R000435
## 4      113      2013-09-19    R000435
## 5      112      2011-11-10    R000595
## 6      113      2013-07-23    C000560
##                                       urls.govtrack
## 1   http://www.govtrack.us/congress/bills/111/hr557
## 2  https://www.govtrack.us/congress/bills/113/s1313
## 3  http://www.govtrack.us/congress/bills/112/hr2829
## 4 https://www.govtrack.us/congress/bills/113/hr3155
## 5   http://www.govtrack.us/congress/bills/112/s1848
## 6  https://www.govtrack.us/congress/bills/113/s1347
##                                 urls.opencongress
## 1  http://www.opencongress.org/bill/111-h557/show
## 2      http://www.opencongress.org/bill/s1313-113
## 3 http://www.opencongress.org/bill/112-h2829/show
## 4     http://www.opencongress.org/bill/hr3155-113
## 5 http://www.opencongress.org/bill/112-s1848/show
## 6      http://www.opencongress.org/bill/s1347-113
##                                          urls.congress
## 1   http://beta.congress.gov/bill/111th/house-bill/557
## 2 http://beta.congress.gov/bill/113th/senate-bill/1313
## 3  http://beta.congress.gov/bill/112th/house-bill/2829
## 4  http://beta.congress.gov/bill/113th/house-bill/3155
## 5 http://beta.congress.gov/bill/112th/senate-bill/1848
## 6 http://beta.congress.gov/bill/113th/senate-bill/1347

Open States API

Search State Bills, in this case search for the term agriculture in Texas.

res <- os_billsearch(terms = 'agriculture', state = 'tx')
head(res)
##                                                                                                                                                 title
## 1 Relating to authorizing the issuance of revenue bonds to fund capital projects at public institutions of higher education; making an appropriation.
## 2                          Relating to authorizing the issuance of revenue bonds to fund capital projects at public institutions of higher education.
## 3                          Relating to authorizing the issuance of revenue bonds to fund capital projects at public institutions of higher education.
## 4                          Relating to authorizing the issuance of revenue bonds to fund capital projects at public institutions of higher education.
## 5 Relating to authorizing the issuance of revenue bonds to fund capital projects at public institutions of higher education; making an appropriation.
## 6                                Relating to access to certain facilities by search and rescue dogs and their handlers; providing a criminal penalty.
##            created_at          updated_at          id chamber state
## 1 2013-08-01 03:33:40 2013-08-07 03:10:10 TXB00034894   upper    tx
## 2 2013-08-01 03:33:38 2013-08-02 03:20:14 TXB00034893   upper    tx
## 3 2013-07-21 03:03:53 2013-07-28 03:28:30 TXB00034814   upper    tx
## 4 2013-07-03 02:44:03 2013-07-14 03:00:31 TXB00034514   upper    tx
## 5 2013-06-16 03:48:13 2013-06-23 04:02:49 TXB00033988   upper    tx
## 6 2013-03-03 04:47:26 2013-07-01 21:25:36 TXB00027556   upper    tx
##   session type
## 1     833 bill
## 2     833 bill
## 3     832 bill
## 4     832 bill
## 5     831 bill
## 6      83 bill
##                                                                             subjects
## 1                                   Commerce, Education, Budget, Spending, and Taxes
## 2                                   Commerce, Education, Budget, Spending, and Taxes
## 3                                   Commerce, Education, Budget, Spending, and Taxes
## 4                                   Commerce, Education, Budget, Spending, and Taxes
## 5                                   Commerce, Education, Budget, Spending, and Taxes
## 6 Commerce, Business and Consumers, Animal Rights and Wildlife Issues, Health, Crime
##   bill_id
## 1    SB 3
## 2   SB 10
## 3   SB 40
## 4    SB 6
## 5   SB 44
## 6 SB 1010

Search for legislators in California (ca) and in the democratic party

res <- os_legislatorsearch(state = 'ca', party = 'democratic', fields = c('full_name','+capitol_office.phone'))
head(res)
##            phone        id       full_name
## 1 (916) 319-2014 CAL000058   Nancy Skinner
## 2 (916) 319-2015 CAL000059   Joan Buchanan
## 3 (916) 319-2022 CAL000084       Paul Fong
## 4 (916) 319-2046 CAL000089      John Pérez
## 5 (916) 319-2080 CAL000098 V. Manuel Pérez
## 6 (916) 319-2001 CAL000101  Wesley Chesbro

Now you can call each representative, yay!

Capitol Words API

Search for phrase climate change used by politicians between September 5th and 16th, 2011:

head(cw_text(phrase='climate change', start_date='2011-09-05', end_date='2011-09-16', party='D')[,c('speaker_last','origin_url')])
##   speaker_last
## 1      Tsongas
## 2       Inslee
## 3        Costa
## 4        Boxer
## 5       Durbin
## 6        Boxer
##                                                                                   origin_url
## 1 http://origin.www.gpo.gov/fdsys/pkg/CREC-2011-09-14/html/CREC-2011-09-14-pt1-PgH6149-5.htm
## 2   http://origin.www.gpo.gov/fdsys/pkg/CREC-2011-09-15/html/CREC-2011-09-15-pt1-PgH6186.htm
## 3 http://origin.www.gpo.gov/fdsys/pkg/CREC-2011-09-13/html/CREC-2011-09-13-pt1-PgE1609-2.htm
## 4   http://origin.www.gpo.gov/fdsys/pkg/CREC-2011-09-15/html/CREC-2011-09-15-pt1-PgS5650.htm
## 5   http://origin.www.gpo.gov/fdsys/pkg/CREC-2011-09-13/html/CREC-2011-09-13-pt1-PgS5510.htm
## 6 http://origin.www.gpo.gov/fdsys/pkg/CREC-2011-09-13/html/CREC-2011-09-13-pt1-PgS5513-2.htm

Plot mentions of the term climate change over time for Democrats vs. Republicans

library('ggplot2')
dat_d <- cw_timeseries(phrase='climate change', party="D")
dat_d$party <- rep("D", nrow(dat_d))
dat_r <- cw_timeseries(phrase='climate change', party="R")
dat_r$party <- rep("R", nrow(dat_r))
dat_both <- rbind(dat_d, dat_r)
ggplot(dat_both, aes(day, count, colour=party)) +
   geom_line() +
   theme_grey(base_size=20) +
   scale_colour_manual(values=c("blue","red"))

plot of chunk unnamed-chunk-9

Influence Explorer API

Search for contributions of equal to or more than $20,000,000.

ie_contr(amount='>|20000000')[,c('amount','recipient_name','contributor_name')]
##         amount
## 1  25177212.00
## 2  20000000.00
## 3  20000000.00
## 4  20000000.00
## 5  20000000.00
## 6  20000000.00
## 7  50000000.00
## 8  34000000.00
## 9  28000000.00
## 10 20000000.00
##                                                   recipient_name
## 1                                       Republican National Cmte
## 2  CALIFORNIANS TO CLOSE THE OUT-OF-STATE CORPORATE TAX LOOPHOLE
## 3                                                   WHITMAN, MEG
## 4                                                   WHITMAN, MEG
## 5                                                   WHITMAN, MEG
## 6                                                   WHITMAN, MEG
## 7                                         GOLISANO, B THOMAS (G)
## 8                                         GOLISANO, B THOMAS (G)
## 9                                         GOLISANO, B THOMAS (G)
## 10                                        GOLISANO, B THOMAS (G)
##           contributor_name
## 1           Romney Victory
## 2         STEYER, THOMAS F
## 3  WHITMAN, MARGARET (MEG)
## 4  WHITMAN, MARGARET (MEG)
## 5  WHITMAN, MARGARET (MEG)
## 6  WHITMAN, MARGARET (MEG)
## 7       GOLISANO, B THOMAS
## 8       GOLISANO, B THOMAS
## 9       GOLISANO, B THOMAS
## 10      GOLISANO, B THOMAS

Top industries, by contributions given. UNKOWN is a very influential industry. Of course law firms are high up there, as well as real estate. I'm sure oil and gas is embarrased that they're contributing less than pulic sector unions.

(res <- ie_industries(method='top_ind', limit=10))
##       count        amount                               id
## 1  14919818 3825359507.21 cdb3f500a3f74179bb4a5eb8b2932fa6
## 2   3600761 2787678962.95 f50cf984a2e3477c8167d32e2b14e052
## 3    329906 1717649914.58 9cac88377c3b400e89c2d6762e3f28f6
## 4   1386613 1707457092.04 7500030dffe24844aa467a75f7aedfd1
## 5    774496 1563637586.57 0af3f418f426497e8bbf916bfc074ebc
## 6    546367 1389220855.35 52e5d4c6c0fa47c3bdb199a28f96d434
## 7   2134350 1384221307.53 a05a0d06f6814b31bece35a81fcb40c7
## 8   1003850  986588892.83 8ada0fc2d6994f2ab06c7e025dff2284
## 9    567082  775241387.17 52766c4910a846f2813a1dda212b7027
## 10   151006  706747646.35 13718be68388456d9b6e8db753f06e72
##    should_show_entity                    name
## 1                TRUE                 UNKNOWN
## 2                TRUE       LAWYERS/LAW FIRMS
## 3                TRUE  CANDIDATE SELF-FINANCE
## 4                TRUE             REAL ESTATE
## 5                TRUE SECURITIES & INVESTMENT
## 6                TRUE    PUBLIC SECTOR UNIONS
## 7                TRUE    HEALTH PROFESSIONALS
## 8                TRUE               INSURANCE
## 9                TRUE               OIL & GAS
## 10               TRUE        CASINOS/GAMBLING
res$amount <- as.numeric(res$amount)
ggplot(res, aes(reorder(name, amount), amount)) +
  geom_bar(stat = "identity") +
  coord_flip() +
  scale_y_continuous(labels=dollar) +
  theme_grey(base_size = 14)

plot of chunk unnamed-chunk-11


Feedback

Please do use rsunlight, and let us know what you want fixed, new features, etc.

Still to come:

  • Functions to visualize data from each API. You can do this yourself, but a few functions will be created to help those that are new to R.
  • Vectorize functions so that you can give many inputs to a function instead of a single input.
  • test suite: embarrasingly, there is no test suite yet, boo me.
  • I plan to push rsunlight to CRAN soon as v0.3