├── data └── .gitkeep ├── images └── .gitkeep ├── template-live-webinar.Rproj ├── README.md ├── .gitignore ├── _r └── notebook.ipynb ├── _python └── notebook.ipynb ├── webinar.yml └── _sql └── notebook.ipynb /data/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /template-live-webinar.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Live Training Session 2 | 3 | Thank you for signing up to conduct a live training session! Please make sure 4 | you have read the detailed instructions in this [document](https://docs.google.com/document/d/1dYZhQVib4-jQwoj_LLmPItXmdEfeyVE0ylEjjU4vrIs/edit) before getting started. 5 | 6 | This template has been designed to help you create your code in notebooks, that 7 | can be easily run by students on [Google Colab](https://colab.research.google.com/). 8 | 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # History files 2 | .Rhistory 3 | .Rapp.history 4 | 5 | # Session Data files 6 | .RData 7 | 8 | # User-specific files 9 | .Ruserdata 10 | 11 | # Example code in package build process 12 | *-Ex.R 13 | 14 | # Output files from R CMD build 15 | /*.tar.gz 16 | 17 | # Output files from R CMD check 18 | /*.Rcheck/ 19 | 20 | # RStudio files 21 | .Rproj.user/ 22 | 23 | # produced vignettes 24 | vignettes/*.html 25 | vignettes/*.pdf 26 | 27 | # OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3 28 | .httr-oauth 29 | 30 | # knitr and R markdown default cache directories 31 | *_cache/ 32 | /cache/ 33 | 34 | # Temporary files created by R markdown 35 | *.utf8.md 36 | *.knit.md 37 | 38 | # R Environment Variables 39 | .Renviron 40 | 41 | # Mac OS 42 | .DS_Store 43 | 44 | -------------------------------------------------------------------------------- /_r/notebook.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "nbformat": 4, 3 | "nbformat_minor": 0, 4 | "metadata": { 5 | "colab": { 6 | "name": "student_notebook.ipynb", 7 | "provenance": [] 8 | }, 9 | "kernelspec": { 10 | "name": "ir", 11 | "display_name": "R" 12 | } 13 | }, 14 | "cells": [ 15 | { 16 | "cell_type": "markdown", 17 | "metadata": { 18 | "id": "OJYbvo8eV-Rd", 19 | "colab_type": "text" 20 | }, 21 | "source": [ 22 | "

\n", 23 | "\"DataCamp\n", 24 | "

\n", 25 | "

\n", 26 | "\n", 27 | "Please run the code below to install additional packages required for this webinar!" 28 | ] 29 | }, 30 | { 31 | "cell_type": "code", 32 | "metadata": { 33 | "id": "KUKG6fNMV_zf", 34 | "colab_type": "code", 35 | "colab": {}, 36 | "cellView": "form" 37 | }, 38 | "source": [ 39 | "#@title Install packages\n" 40 | ], 41 | "execution_count": 0, 42 | "outputs": [] 43 | } 44 | ] 45 | } -------------------------------------------------------------------------------- /_python/notebook.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "nbformat": 4, 3 | "nbformat_minor": 0, 4 | "metadata": { 5 | "colab": { 6 | "name": "Untitled5.ipynb", 7 | "provenance": [] 8 | }, 9 | "kernelspec": { 10 | "name": "python3", 11 | "display_name": "Python 3" 12 | } 13 | }, 14 | "cells": [ 15 | { 16 | "cell_type": "markdown", 17 | "metadata": { 18 | "id": "tRQcWN1Edm0p", 19 | "colab_type": "text" 20 | }, 21 | "source": [ 22 | "

\n", 23 | "\"DataCamp\n", 24 | "

\n", 25 | "

\n", 26 | "\n", 27 | "Please run the code below to install additional packages required for this webinar!" 28 | ] 29 | }, 30 | { 31 | "cell_type": "code", 32 | "metadata": { 33 | "id": "0dpufov7dnk4", 34 | "colab_type": "code", 35 | "colab": {}, 36 | "cellView": "form" 37 | }, 38 | "source": [ 39 | "#@title Install packages\n" 40 | ], 41 | "execution_count": 0, 42 | "outputs": [] 43 | } 44 | ] 45 | } -------------------------------------------------------------------------------- /webinar.yml: -------------------------------------------------------------------------------- 1 | # A catch and descriptive title for the webinar. 2 | title: Building Web Apps with Shiny 3 | # The technology used [r / python/ sql] 4 | technology: r 5 | # The url slug to be used for the webinar 6 | slug: building-web-apps-withs-shiny 7 | # The registration link on GotoWebinar 8 | registerLink: https://attendee.gotowebinar.com/register/ 9 | # The date and time for the webinar in the same format 10 | time: 'Wednesday 15 April, 11 AM EST, 4 PM BST' 11 | # A description of the webinar 12 | description: > 13 | Join us for this live, hands-on training where you will learn how to apply 14 | the power of shiny to build web applications with R. This session will run 15 | for three hours, allowing you time to really immerse yourself in the subject, 16 | and includes short breaks and opportunities to ask the expert questions 17 | throughout the training. 18 | # A list of key learning objectives 19 | whatWillILearn: 20 | - Apply your DataCamp knowledge to new data 21 | - Identify and transform data to create common graphics with ggplot2 22 | - Create and use plots to answer common data questions 23 | - Share visualizations to answer business questions 24 | # A description of how to prepare for the webinar 25 | whatShouldIPrepare: > 26 | You can join the webinar from your web browser following the instructions 27 | you receive in your registration email. All required data/resources will be 28 | provided in the training. 29 | # A description of who should attend the webinar and what courses are prereqs. 30 | whoShouldAttend: 31 | text: > 32 | This course is open to all DataCamp Premium learners, looking to improve 33 | their data visualization skills. We recommend that you have taken at least 34 | one of the following courses before attending: 35 | courses: 36 | - title: Introduction to Data Visualization with ggplot2 37 | path: /courses/introduction-to-data-visualization-with-ggplot2 38 | - title: Data Visualization with ggplot2 (part 1) 39 | path: /courses/data-visualization-with-ggplot2-1 40 | - title: Introduction to the Tidyverse 41 | path: /courses/introduction-to-the-tidyverse 42 | # Some details about the instructor 43 | instructor: 44 | name: Ramnath Vaidyanathan 45 | title: VP of Product Research 46 | image: 47 | description: > 48 | Ramnath is the VP of Product Research at DataCamp, where he helps drive 49 | product innovation and data-driven development. Ramnath has a PhD in 50 | Operations Management from the Wharton School, and has worked as an 51 | Assistant Professor at the Desautels Faculty of Management, McGill 52 | University 53 | linkedIn: https://www.linkedin.com/in/ramnathv 54 | -------------------------------------------------------------------------------- /_sql/notebook.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "nbformat": 4, 3 | "nbformat_minor": 0, 4 | "metadata": { 5 | "colab": { 6 | "name": "Untitled5.ipynb", 7 | "provenance": [] 8 | }, 9 | "kernelspec": { 10 | "name": "python3", 11 | "display_name": "Python 3" 12 | } 13 | }, 14 | "cells": [ 15 | { 16 | "cell_type": "markdown", 17 | "metadata": { 18 | "id": "tRQcWN1Edm0p", 19 | "colab_type": "text" 20 | }, 21 | "source": [ 22 | "

\n", 23 | "\"DataCamp\n", 24 | "

\n", 25 | "

\n", 26 | "\n" 27 | ] 28 | }, 29 | { 30 | "cell_type": "markdown", 31 | "metadata": { 32 | "id": "GUV6DZ6Qfz6h", 33 | "colab_type": "text" 34 | }, 35 | "source": [ 36 | "# Setup\n", 37 | "\n", 38 | "Before we get started, we need to do some initial setup. Please run the cells below to install postgress, start the server, load sql extensions, download data, and create the required database tables. This will take a few minutes on the first run." 39 | ] 40 | }, 41 | { 42 | "cell_type": "code", 43 | "metadata": { 44 | "id": "0dpufov7dnk4", 45 | "colab_type": "code", 46 | "colab": {}, 47 | "cellView": "both" 48 | }, 49 | "source": [ 50 | "#@title Install postgres and start server\n", 51 | "%%capture\n", 52 | "!wget -qO- https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -\n", 53 | "!echo \"deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main\" >/etc/apt/sources.list.d/pgdg.list\n", 54 | "!apt -qq update\n", 55 | "!apt -yq install postgresql-12 postgresql-client-12\n", 56 | "!service postgresql start\n", 57 | "# make calling psql shorter\n", 58 | "!sudo -u postgres psql -c \"CREATE USER root WITH SUPERUSER\" \n", 59 | "!psql postgres -c \"CREATE DATABASE root\" # now just !psql -c \"...\"\n", 60 | "# load SQL extensions\n", 61 | "%load_ext sql\n", 62 | "%config SqlMagic.feedback=False \n", 63 | "%config SqlMagic.autopandas=True\n", 64 | "%sql postgresql+psycopg2://@/postgres" 65 | ], 66 | "execution_count": 0, 67 | "outputs": [] 68 | }, 69 | { 70 | "cell_type": "code", 71 | "metadata": { 72 | "id": "TlbbE1CxfbKU", 73 | "colab_type": "code", 74 | "colab": {}, 75 | "cellView": "form" 76 | }, 77 | "source": [ 78 | "#@title Download data as CSV files\n", 79 | "!wget -q https://raw.githubusercontent.com/baldwint/binder-postgres/postgres/data/actor.csv" 80 | ], 81 | "execution_count": 0, 82 | "outputs": [] 83 | }, 84 | { 85 | "cell_type": "code", 86 | "metadata": { 87 | "id": "w72wAJVBfcHW", 88 | "colab_type": "code", 89 | "colab": { 90 | "base_uri": "https://localhost:8080/", 91 | "height": 49 92 | }, 93 | "cellView": "form", 94 | "outputId": "779a5675-65bc-4999-9d65-420c85477104" 95 | }, 96 | "source": [ 97 | "#@title Create Tables\n", 98 | "%%sql\n", 99 | "DROP TABLE IF EXISTS actor;\n", 100 | "CREATE TABLE actor(\n", 101 | " actor_id int primary key,\n", 102 | " first_name varchar(50),\n", 103 | " last_name varchar(50),\n", 104 | " last_update timestamp\n", 105 | ");\n", 106 | "COPY actor\n", 107 | "FROM '/content/actor.csv' DELIMITER ',' CSV HEADER;" 108 | ], 109 | "execution_count": 3, 110 | "outputs": [ 111 | { 112 | "output_type": "stream", 113 | "text": [ 114 | " * postgresql+psycopg2://@/postgres\n" 115 | ], 116 | "name": "stdout" 117 | }, 118 | { 119 | "output_type": "execute_result", 120 | "data": { 121 | "text/html": [ 122 | "
\n", 123 | "\n", 136 | "\n", 137 | " \n", 138 | " \n", 139 | " \n", 140 | " \n", 141 | " \n", 142 | " \n", 143 | " \n", 144 | "
\n", 145 | "
" 146 | ], 147 | "text/plain": [ 148 | "Empty DataFrame\n", 149 | "Columns: []\n", 150 | "Index: []" 151 | ] 152 | }, 153 | "metadata": { 154 | "tags": [] 155 | }, 156 | "execution_count": 3 157 | } 158 | ] 159 | }, 160 | { 161 | "cell_type": "markdown", 162 | "metadata": { 163 | "id": "yd7tHlVpgGjx", 164 | "colab_type": "text" 165 | }, 166 | "source": [ 167 | "# Get Started" 168 | ] 169 | }, 170 | { 171 | "cell_type": "code", 172 | "metadata": { 173 | "id": "kbKrfnA8gIDm", 174 | "colab_type": "code", 175 | "colab": { 176 | "base_uri": "https://localhost:8080/", 177 | "height": 376 178 | }, 179 | "outputId": "3bfb0cdb-17eb-4175-a7f9-6d4182801297" 180 | }, 181 | "source": [ 182 | "%%sql\n", 183 | "SELECT * FROM actor LIMIT 10" 184 | ], 185 | "execution_count": 4, 186 | "outputs": [ 187 | { 188 | "output_type": "stream", 189 | "text": [ 190 | " * postgresql+psycopg2://@/postgres\n" 191 | ], 192 | "name": "stdout" 193 | }, 194 | { 195 | "output_type": "execute_result", 196 | "data": { 197 | "text/html": [ 198 | "
\n", 199 | "\n", 212 | "\n", 213 | " \n", 214 | " \n", 215 | " \n", 216 | " \n", 217 | " \n", 218 | " \n", 219 | " \n", 220 | " \n", 221 | " \n", 222 | " \n", 223 | " \n", 224 | " \n", 225 | " \n", 226 | " \n", 227 | " \n", 228 | " \n", 229 | " \n", 230 | " \n", 231 | " \n", 232 | " \n", 233 | " \n", 234 | " \n", 235 | " \n", 236 | " \n", 237 | " \n", 238 | " \n", 239 | " \n", 240 | " \n", 241 | " \n", 242 | " \n", 243 | " \n", 244 | " \n", 245 | " \n", 246 | " \n", 247 | " \n", 248 | " \n", 249 | " \n", 250 | " \n", 251 | " \n", 252 | " \n", 253 | " \n", 254 | " \n", 255 | " \n", 256 | " \n", 257 | " \n", 258 | " \n", 259 | " \n", 260 | " \n", 261 | " \n", 262 | " \n", 263 | " \n", 264 | " \n", 265 | " \n", 266 | " \n", 267 | " \n", 268 | " \n", 269 | " \n", 270 | " \n", 271 | " \n", 272 | " \n", 273 | " \n", 274 | " \n", 275 | " \n", 276 | " \n", 277 | " \n", 278 | " \n", 279 | " \n", 280 | " \n", 281 | " \n", 282 | " \n", 283 | " \n", 284 | " \n", 285 | " \n", 286 | " \n", 287 | " \n", 288 | " \n", 289 | " \n", 290 | " \n", 291 | " \n", 292 | " \n", 293 | " \n", 294 | "
actor_idfirst_namelast_namelast_update
01PenelopeGuiness2006-02-15 10:05:00
12NickWahlberg2006-02-15 10:05:00
23EdChase2006-02-15 10:05:00
34JenniferDavis2006-02-15 10:05:00
45JohnnyLollobrigida2006-02-15 10:05:00
56BetteNicholson2006-02-15 10:05:00
67GraceMostel2006-02-15 10:05:00
78MatthewJohansson2006-02-15 10:05:00
89JoeSwank2006-02-15 10:05:00
910ChristianGable2006-02-15 10:05:00
\n", 295 | "
" 296 | ], 297 | "text/plain": [ 298 | " actor_id first_name last_name last_update\n", 299 | "0 1 Penelope Guiness 2006-02-15 10:05:00\n", 300 | "1 2 Nick Wahlberg 2006-02-15 10:05:00\n", 301 | "2 3 Ed Chase 2006-02-15 10:05:00\n", 302 | "3 4 Jennifer Davis 2006-02-15 10:05:00\n", 303 | "4 5 Johnny Lollobrigida 2006-02-15 10:05:00\n", 304 | "5 6 Bette Nicholson 2006-02-15 10:05:00\n", 305 | "6 7 Grace Mostel 2006-02-15 10:05:00\n", 306 | "7 8 Matthew Johansson 2006-02-15 10:05:00\n", 307 | "8 9 Joe Swank 2006-02-15 10:05:00\n", 308 | "9 10 Christian Gable 2006-02-15 10:05:00" 309 | ] 310 | }, 311 | "metadata": { 312 | "tags": [] 313 | }, 314 | "execution_count": 4 315 | } 316 | ] 317 | } 318 | ] 319 | } --------------------------------------------------------------------------------