Skip to content

Commit

Permalink
Publishes deck, adds sql script
Browse files Browse the repository at this point in the history
  • Loading branch information
edgararuiz committed Jan 17, 2019
1 parent d163c2d commit e6c2912
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The source code of the RMarkdown presentation deck and RNotebook are available i

Rendered versions of the materials can be found here:

- Presentation:
- Presentation: https://beta.rstudioconnect.com/content/4536/databases-using-R.html#1

- Demo RNotebook: https://beta.rstudioconnect.com/content/4534/austin-311-calls.nb.html

Expand Down
3 changes: 3 additions & 0 deletions demo/sql-ide.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- !preview conn=DBI::dbConnect(odbc(), Driver = "SQL Server", Server = "localhost\\SQLEXPRESS", Database = "datawarehouse", Trusted_Connection = "True")

select top 100 * from airports
1 change: 1 addition & 0 deletions presentation/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rsconnect
5 changes: 3 additions & 2 deletions presentation/databases-using-R.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,10 @@ class: subtitle-slide, white, right, center

**Database:** Google BigQuery Public Data


---
class: panel-narrow-slide, left

# What to look foward to
# What to look forward to

--
### - Improve existing translations
Expand All @@ -206,3 +205,5 @@ class: panel-narrow-slide, left
class: blank-slide, blue, center, middle

# Thank you!

## rstd.io/db
13 changes: 7 additions & 6 deletions presentation/databases-using-R.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,16 @@

61 packages are DB themed & depend on DBI and/or dbplyr

<div id="htmlwidget-2f315ec70ce08da1a4df" style="width:1008px;height:432px;" class="visNetwork html-widget"></div>
<script type="application/json" data-for="htmlwidget-2f315ec70ce08da1a4df">{"x":{"nodes":{"id":["anchoredDistr","arkdb","BIEN","bigrquery","biolink","cdata","condusco","cRegulome","DatabaseConnector","dbfaker","DBI","dbparser","dbplot","dbplyr","dbx","dplyr.teradata","drfit","emuR","etl","ETLUtils","filehashSQLite","gmDatabase","implyr","liteq","mdsr","Mega2R","MetamapsDB","mlbgameday","modeldb","MonetDBLite","ODB","odbc","ora","PhysicalActivity","pitchRx","PivotalR","pointblank","poplite","postGIStools","RClickhouse","redcapAPI","replyr","restez","RGreenplum","RMariaDB","rpostgis","rpostgisLT","RPostgres","RPostgreSQL","RPresto","rqdatatable","rquery","RSQLite","sergeant","sqldf","sqlscore","storr","taxizedb","tidypredict","tigreBrowserWriter","TScompare","TSdbi","TSsdmx","TSsql"],"label":["anchoredDistr","arkdb","BIEN","bigrquery","biolink","cdata","condusco","cRegulome","DatabaseConnector","dbfaker","DBI","dbparser","dbplot","dbplyr","dbx","dplyr.teradata","drfit","emuR","etl","ETLUtils","filehashSQLite","gmDatabase","implyr","liteq","mdsr","Mega2R","MetamapsDB","mlbgameday","modeldb","MonetDBLite","ODB","odbc","ora","PhysicalActivity","pitchRx","PivotalR","pointblank","poplite","postGIStools","RClickhouse","redcapAPI","replyr","restez","RGreenplum","RMariaDB","rpostgis","rpostgisLT","RPostgres","RPostgreSQL","RPresto","rqdatatable","rquery","RSQLite","sergeant","sqldf","sqlscore","storr","taxizedb","tidypredict","tigreBrowserWriter","TScompare","TSdbi","TSsdmx","TSsql"],"shape":["ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","circle","ellipse","ellipse","circle","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","circle","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse"],"color":["#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ff6600","#ffffcc","#ffffcc","#ff9900","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#cc6633","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc"]},"edges":{"to":["anchoredDistr","arkdb","arkdb","BIEN","bigrquery","bigrquery","biolink","cdata","condusco","cRegulome","DatabaseConnector","dbfaker","dbparser","dbparser","dbplot","dbplyr","dbx","dbx","dplyr.teradata","dplyr.teradata","dplyr.teradata","drfit","drfit","emuR","etl","etl","ETLUtils","filehashSQLite","filehashSQLite","gmDatabase","implyr","implyr","implyr","liteq","mdsr","mdsr","Mega2R","MetamapsDB","mlbgameday","mlbgameday","modeldb","modeldb","MonetDBLite","MonetDBLite","ODB","odbc","ora","PhysicalActivity","pitchRx","PivotalR","pointblank","poplite","poplite","postGIStools","RClickhouse","RClickhouse","redcapAPI","replyr","restez","RGreenplum","RMariaDB","rpostgis","rpostgisLT","RPostgres","RPostgreSQL","RPresto","RPresto","rqdatatable","rquery","RSQLite","sergeant","sergeant","sqldf","sqlscore","storr","taxizedb","taxizedb","tidypredict","tidypredict","tigreBrowserWriter","TScompare","TSdbi","TSsdmx","TSsql"],"from":["DBI","DBI","dbplyr","DBI","DBI","dbplyr","DBI","DBI","DBI","DBI","DBI","DBI","DBI","odbc","dbplyr","DBI","DBI","odbc","DBI","odbc","dbplyr","odbc","DBI","DBI","DBI","dbplyr","DBI","DBI","DBI","DBI","dbplyr","DBI","odbc","DBI","DBI","dbplyr","DBI","DBI","DBI","dbplyr","dbplyr","DBI","DBI","dbplyr","DBI","DBI","DBI","DBI","DBI","DBI","DBI","dbplyr","DBI","DBI","dbplyr","DBI","DBI","DBI","DBI","DBI","DBI","DBI","DBI","DBI","DBI","DBI","dbplyr","DBI","DBI","DBI","DBI","dbplyr","DBI","dbplyr","DBI","DBI","dbplyr","dbplyr","DBI","DBI","DBI","DBI","DBI","DBI"]},"nodesToDataframe":true,"edgesToDataframe":true,"options":{"width":"100%","height":"100%","nodes":{"shape":"dot"},"manipulation":{"enabled":false},"layout":{"randomSeed":10},"interaction":{"navigationButtons":true}},"groups":null,"width":null,"height":null,"idselection":{"enabled":false},"byselection":{"enabled":false},"main":null,"submain":null,"footer":null,"background":"rgba(0, 0, 0, 0)","tooltipStay":300,"tooltipStyle":"position: fixed;visibility:hidden;padding: 5px;white-space: nowrap;font-family: verdana;font-size:14px;font-color:#000000;background-color: #f5f4ed;-moz-border-radius: 3px;-webkit-border-radius: 3px;border-radius: 3px;border: 1px solid #808074;box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);"},"evals":[],"jsHooks":[]}</script>
<div id="htmlwidget-7c7b6dbbec939bd0e0b2" style="width:1008px;height:432px;" class="visNetwork html-widget"></div>
<script type="application/json" data-for="htmlwidget-7c7b6dbbec939bd0e0b2">{"x":{"nodes":{"id":["anchoredDistr","arkdb","BIEN","bigrquery","biolink","cdata","condusco","cRegulome","DatabaseConnector","dbfaker","DBI","dbparser","dbplot","dbplyr","dbx","dplyr.teradata","drfit","emuR","etl","ETLUtils","filehashSQLite","gmDatabase","implyr","liteq","mdsr","Mega2R","MetamapsDB","mlbgameday","modeldb","MonetDBLite","ODB","odbc","ora","PhysicalActivity","pitchRx","PivotalR","pointblank","poplite","postGIStools","RClickhouse","redcapAPI","replyr","restez","RGreenplum","RMariaDB","rpostgis","rpostgisLT","RPostgres","RPostgreSQL","RPresto","rqdatatable","rquery","RSQLite","sergeant","sqldf","sqlscore","storr","taxizedb","tidypredict","tigreBrowserWriter","TScompare","TSdbi","TSsdmx","TSsql"],"label":["anchoredDistr","arkdb","BIEN","bigrquery","biolink","cdata","condusco","cRegulome","DatabaseConnector","dbfaker","DBI","dbparser","dbplot","dbplyr","dbx","dplyr.teradata","drfit","emuR","etl","ETLUtils","filehashSQLite","gmDatabase","implyr","liteq","mdsr","Mega2R","MetamapsDB","mlbgameday","modeldb","MonetDBLite","ODB","odbc","ora","PhysicalActivity","pitchRx","PivotalR","pointblank","poplite","postGIStools","RClickhouse","redcapAPI","replyr","restez","RGreenplum","RMariaDB","rpostgis","rpostgisLT","RPostgres","RPostgreSQL","RPresto","rqdatatable","rquery","RSQLite","sergeant","sqldf","sqlscore","storr","taxizedb","tidypredict","tigreBrowserWriter","TScompare","TSdbi","TSsdmx","TSsql"],"shape":["ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","circle","ellipse","ellipse","circle","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","circle","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse","ellipse"],"color":["#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ff6600","#ffffcc","#ffffcc","#ff9900","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#cc6633","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc","#ffffcc"]},"edges":{"to":["anchoredDistr","arkdb","arkdb","BIEN","bigrquery","bigrquery","biolink","cdata","condusco","cRegulome","DatabaseConnector","dbfaker","dbparser","dbparser","dbplot","dbplyr","dbx","dbx","dplyr.teradata","dplyr.teradata","dplyr.teradata","drfit","drfit","emuR","etl","etl","ETLUtils","filehashSQLite","filehashSQLite","gmDatabase","implyr","implyr","implyr","liteq","mdsr","mdsr","Mega2R","MetamapsDB","mlbgameday","mlbgameday","modeldb","modeldb","MonetDBLite","MonetDBLite","ODB","odbc","ora","PhysicalActivity","pitchRx","PivotalR","pointblank","poplite","poplite","postGIStools","RClickhouse","RClickhouse","redcapAPI","replyr","restez","RGreenplum","RMariaDB","rpostgis","rpostgisLT","RPostgres","RPostgreSQL","RPresto","RPresto","rqdatatable","rquery","RSQLite","sergeant","sergeant","sqldf","sqlscore","storr","taxizedb","taxizedb","tidypredict","tidypredict","tigreBrowserWriter","TScompare","TSdbi","TSsdmx","TSsql"],"from":["DBI","DBI","dbplyr","DBI","DBI","dbplyr","DBI","DBI","DBI","DBI","DBI","DBI","DBI","odbc","dbplyr","DBI","DBI","odbc","DBI","odbc","dbplyr","odbc","DBI","DBI","DBI","dbplyr","DBI","DBI","DBI","DBI","dbplyr","DBI","odbc","DBI","DBI","dbplyr","DBI","DBI","DBI","dbplyr","dbplyr","DBI","DBI","dbplyr","DBI","DBI","DBI","DBI","DBI","DBI","DBI","dbplyr","DBI","DBI","dbplyr","DBI","DBI","DBI","DBI","DBI","DBI","DBI","DBI","DBI","DBI","DBI","dbplyr","DBI","DBI","DBI","DBI","dbplyr","DBI","dbplyr","DBI","DBI","dbplyr","dbplyr","DBI","DBI","DBI","DBI","DBI","DBI"]},"nodesToDataframe":true,"edgesToDataframe":true,"options":{"width":"100%","height":"100%","nodes":{"shape":"dot"},"manipulation":{"enabled":false},"layout":{"randomSeed":10},"interaction":{"navigationButtons":true}},"groups":null,"width":null,"height":null,"idselection":{"enabled":false},"byselection":{"enabled":false},"main":null,"submain":null,"footer":null,"background":"rgba(0, 0, 0, 0)","tooltipStay":300,"tooltipStyle":"position: fixed;visibility:hidden;padding: 5px;white-space: nowrap;font-family: verdana;font-size:14px;font-color:#000000;background-color: #f5f4ed;-moz-border-radius: 3px;-webkit-border-radius: 3px;border-radius: 3px;border: 1px solid #808074;box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);"},"evals":[],"jsHooks":[]}</script>

---
class: panel-narrow-slide, left

# 87% have been updated since 2017

<div id="htmlwidget-a3fd13ce7e975ac829fd" style="width:1008px;height:432px;" class="r2d3 html-widget"></div>
<script type="application/json" data-for="htmlwidget-a3fd13ce7e975ac829fd">{"x":{"data":{"yr":[2012,2014,2015,2016,2017,2018,2019],"n":[2,1,2,3,12,35,8],"label":["2012","2014","2015","2016","2017","2018","2019"],"x":[2012,2014,2015,2016,2017,2018,2019],"y":[2,1,2,3,12,35,8]},"type":"data.frame","container":"svg","options":null,"script":"var d3Script = function(d3, r2d3, data, svg, width, height, options, theme, console) {\nthis.d3 = d3;\n\nsvg = d3.select(svg.node());\n/* R2D3 Source File: col_plot.js */\n// !preview r2d3 data=data.frame(y = c(5000,100,3000,4000), x = c(1,2,4,5), label = c('jan', 'feb', 'mar', 'apr'))\n\nvar layer_left = 0.01;\n layer_top = 0.1;\n layer_height = 0.9;\n layer_width = 0.97;\n\nfunction svg_height() {return parseInt(svg.style('height'))}\nfunction svg_width() {return parseInt(svg.style('width'))}\nfunction actual_max() {return d3.max(data, function (d) {return d.y; }); }\nfunction col_width() {return svg_width() / data.length * layer_width;}\nfunction col_heigth() {return (svg_height() /actual_max()) * layer_height; }\n\nfunction col_top() {return svg_height() * layer_top; }\nfunction col_left() {return svg_width() * layer_left;}\n\nvar cols = svg.selectAll('rect').data(data);\n\ncols.enter().append('rect')\n .attr('height', function(d) {return (d.y * col_heigth()); })\n .attr('width', col_width())\n .attr('x', function(d, i) {return (i * col_width()) + (svg_width()* layer_left); })\n .attr('y', function(d) {return col_top() + ((actual_max() - d.y) * col_heigth()); })\n .attr('fill', '#009E73')\n .attr('opacity', 0.5)\n .attr('stroke', 'white')\n .attr('d', function(d) { return d.x; })\n .on(\"click\", function(){\n Shiny.setInputValue(\n \"column_clicked\", \n d3.select(this).attr(\"d\"),\n {priority: \"event\"}\n );\n }) \n .on(\"mouseenter\", function(){\n d3.select(this)\n .attr('opacity', 1)\n .attr('fill', '#ffb14e'); \n })\n .on(\"mouseleave\", function(){\n d3.select(this)\n .attr('opacity', 0.5)\n .attr('fill', '#009E73');\n }); \n \ncols.exit().remove();\n\n\n// Identity labels\n\nvar txt = svg.selectAll('text').data(data);\n\ntxt.enter().append('text')\n .attr('x', function(d, i) {return (i * col_width()) + (svg_width()* layer_left) + (col_width() * 0.5); })\n .attr('y', function(d) {return svg_height()* 0.98;})\n .style('font-size', '20px') \n .text(function(d) {return d.label;})\n .style('font-family', 'sans-serif')\n .attr('text-anchor', 'middle');\n \n \ntxt.exit().remove();\n\n// Numeric labels\n\nvar totals = svg.selectAll('totals').data(data);\n\ntotals.enter().append('text')\n .attr('x', function(d, i) {return (i * col_width()) + (svg_width()* layer_left) + (col_width() * 0.5); })\n .attr('y', function(d) {return (col_top() * 0.6) + ((actual_max() - d.y) * col_heigth()); })\n .attr('text-anchor', 'middle')\n .style('font-size', '30px') \n .style('font-family', 'sans-serif')\n .text(function(d) {return d.y; }); \n \ntotals.exit().remove();\n};","style":null,"version":5,"theme":{"default":{"background":"#FFFFFF","foreground":"#000000"},"runtime":null},"useShadow":true},"evals":[],"jsHooks":[]}</script>
<div id="htmlwidget-00b4cc8962b1280948ac" style="width:1008px;height:432px;" class="r2d3 html-widget"></div>
<script type="application/json" data-for="htmlwidget-00b4cc8962b1280948ac">{"x":{"data":{"yr":[2012,2014,2015,2016,2017,2018,2019],"n":[2,1,2,3,12,35,8],"label":["2012","2014","2015","2016","2017","2018","2019"],"x":[2012,2014,2015,2016,2017,2018,2019],"y":[2,1,2,3,12,35,8]},"type":"data.frame","container":"svg","options":null,"script":"var d3Script = function(d3, r2d3, data, svg, width, height, options, theme, console) {\nthis.d3 = d3;\n\nsvg = d3.select(svg.node());\n/* R2D3 Source File: col_plot.js */\n// !preview r2d3 data=data.frame(y = c(5000,100,3000,4000), x = c(1,2,4,5), label = c('jan', 'feb', 'mar', 'apr'))\n\nvar layer_left = 0.01;\n layer_top = 0.1;\n layer_height = 0.9;\n layer_width = 0.97;\n\nfunction svg_height() {return parseInt(svg.style('height'))}\nfunction svg_width() {return parseInt(svg.style('width'))}\nfunction actual_max() {return d3.max(data, function (d) {return d.y; }); }\nfunction col_width() {return svg_width() / data.length * layer_width;}\nfunction col_heigth() {return (svg_height() /actual_max()) * layer_height; }\n\nfunction col_top() {return svg_height() * layer_top; }\nfunction col_left() {return svg_width() * layer_left;}\n\nvar cols = svg.selectAll('rect').data(data);\n\ncols.enter().append('rect')\n .attr('height', function(d) {return (d.y * col_heigth()); })\n .attr('width', col_width())\n .attr('x', function(d, i) {return (i * col_width()) + (svg_width()* layer_left); })\n .attr('y', function(d) {return col_top() + ((actual_max() - d.y) * col_heigth()); })\n .attr('fill', '#009E73')\n .attr('opacity', 0.5)\n .attr('stroke', 'white')\n .attr('d', function(d) { return d.x; })\n .on(\"click\", function(){\n Shiny.setInputValue(\n \"column_clicked\", \n d3.select(this).attr(\"d\"),\n {priority: \"event\"}\n );\n }) \n .on(\"mouseenter\", function(){\n d3.select(this)\n .attr('opacity', 1)\n .attr('fill', '#ffb14e'); \n })\n .on(\"mouseleave\", function(){\n d3.select(this)\n .attr('opacity', 0.5)\n .attr('fill', '#009E73');\n }); \n \ncols.exit().remove();\n\n\n// Identity labels\n\nvar txt = svg.selectAll('text').data(data);\n\ntxt.enter().append('text')\n .attr('x', function(d, i) {return (i * col_width()) + (svg_width()* layer_left) + (col_width() * 0.5); })\n .attr('y', function(d) {return svg_height()* 0.98;})\n .style('font-size', '20px') \n .text(function(d) {return d.label;})\n .style('font-family', 'sans-serif')\n .attr('text-anchor', 'middle');\n \n \ntxt.exit().remove();\n\n// Numeric labels\n\nvar totals = svg.selectAll('totals').data(data);\n\ntotals.enter().append('text')\n .attr('x', function(d, i) {return (i * col_width()) + (svg_width()* layer_left) + (col_width() * 0.5); })\n .attr('y', function(d) {return (col_top() * 0.6) + ((actual_max() - d.y) * col_heigth()); })\n .attr('text-anchor', 'middle')\n .style('font-size', '30px') \n .style('font-family', 'sans-serif')\n .text(function(d) {return d.y; }); \n \ntotals.exit().remove();\n};","style":null,"version":5,"theme":{"default":{"background":"#FFFFFF","foreground":"#000000"},"runtime":null},"useShadow":true},"evals":[],"jsHooks":[]}</script>

---
class: subtitle-slide, white, middle, center
Expand All @@ -117,11 +117,10 @@

**Database:** Google BigQuery Public Data


---
class: panel-narrow-slide, left

# What to look foward to
# What to look forward to

--
### - Improve existing translations
Expand All @@ -139,6 +138,8 @@
class: blank-slide, blue, center, middle

# Thank you!

## rstd.io/db
</textarea>
<script src="https://remarkjs.com/downloads/remark-latest.min.js"></script>
<script>var slideshow = remark.create({
Expand Down

0 comments on commit e6c2912

Please sign in to comment.