Last active
August 29, 2015 14:07
-
-
Save jeroenjanssens/19389159c1331de0d459 to your computer and use it in GitHub Desktop.
Data Science at the Command Line Strata Tutorial
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# make sure that you have the R package `ggmap` installed | |
curl -s http://api.citybik.es/citi-bike-nyc.json > citibikes.json | |
< citibikes.json jq -r '.[] | [.lat/1000000,.lng/1000000,.bikes] | @csv' | header -a lat,lng,bikes > citibikes.csv | |
< citibikes.csv Rio -vge 'require(ggmap); qmap("NYC", zoom=14) + geom_point(data=df, aes(x=lng, y=lat, size=bikes))' > citibikes.png |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ curl -sL 'http://en.wikipedia.org/wiki/List_of_countries_and_territories_by_border/area_ratio' | scrape -be 'table.wikitable > tr:not(:first-child)' | xml2json | jq -c '.html.body.tr[] | {country: .td[1][], border: .td[2][], surface: .td[3][], ratio: .td[4][]}' | json2csv -p -k=border,surface | head -n 11 | csvlook |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think you misspelled
data
in the Rio expression. Please see the updated commands incase-citibikes.sh
and let me know if that works. (If you get an error in Rio, you can also specify the-v
option to see the error.)