├── data
└── .gitkeep
├── binder
├── install.R
└── Dockerfile
├── template-r-project.Rproj
├── .gitignore
├── LICENSE
├── webinar.yml
├── notebooks
└── R_live_session_template.ipynb
├── assets
└── datacamp.svg
└── README.md
/data/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/binder/install.R:
--------------------------------------------------------------------------------
1 | # Install additional packages
2 |
--------------------------------------------------------------------------------
/template-r-project.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 |
15 | AutoAppendNewline: Yes
16 | StripTrailingWhitespace: Yes
17 |
--------------------------------------------------------------------------------
/binder/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM rocker/binder:3.6.2
2 |
3 | ## Declares build arguments
4 | ARG NB_USER
5 | ARG NB_UID
6 |
7 | ## Copies your repo files into the Docker Container
8 | USER root
9 | COPY . ${HOME}
10 | ## Enable this to copy files from the binder subdirectory
11 | ## to the home, overriding any existing files.
12 | ## Useful to create a setup on binder that is different from a
13 | ## clone of your repository
14 | COPY binder ${HOME}
15 | RUN chown -R ${NB_USER} ${HOME}
16 |
17 | ## Become normal user again
18 | USER ${NB_USER}
19 |
20 | ## Run an install.R script, if it exists.
21 | RUN if [ -f install.R ]; then R --quiet -f install.R; fi
22 |
--------------------------------------------------------------------------------
/.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 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Ramnath Vaidyanathan
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/notebooks/R_live_session_template.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 | "\n",
24 | "
\n",
25 | "
\n",
26 | "\n",
27 | "## **R Live Training Template**\n",
28 | "\n",
29 | "_Enter a brief description of your session, here's an example below:_\n",
30 | "\n",
31 | "Welcome to this hands-on training where we will immerse yourself in data visualization in R. Using `ggplot2` and `dplyr`, we'll learn how to create visualizations that are presentation-ready.\n",
32 | "\n",
33 | "The ability to present and discuss\n",
34 | "\n",
35 | "* Create various types of plots, including bar-plots, distribution plots, box-plots and more using Seaborn and Matplotlib.\n",
36 | "* Format and stylize your visualizations to make them report-ready.\n",
37 | "* Create sub-plots to create clearer visualizations and supercharge your workflow.\n",
38 | "\n",
39 | "## **The Dataset**\n",
40 | "\n",
41 | "_Enter a brief description of your dataset and its columns, here's an example below:_\n",
42 | "\n",
43 | "\n",
44 | "The dataset to be used in this webinar is a CSV file named `airbnb.csv`, which contains data on airbnb listings in the state of New York. It contains the following columns:\n",
45 | "\n",
46 | "- `listing_id`: The unique identifier for a listing\n",
47 | "- `description`: The description used on the listing\n",
48 | "- `host_id`: Unique identifier for a host\n",
49 | "- `host_name`: Name of host\n",
50 | "- `neighbourhood_full`: Name of boroughs and neighbourhoods\n",
51 | "- `coordinates`: Coordinates of listing _(latitude, longitude)_\n",
52 | "- `Listing added`: Date of added listing\n",
53 | "- `room_type`: Type of room \n",
54 | "- `rating`: Rating from 0 to 5.\n",
55 | "- `price`: Price per night for listing\n",
56 | "- `number_of_reviews`: Amount of reviews received \n",
57 | "- `last_review`: Date of last review\n",
58 | "- `reviews_per_month`: Number of reviews per month\n",
59 | "- `availability_365`: Number of days available per year\n",
60 | "- `Number of stays`: Total number of stays thus far\n"
61 | ]
62 | },
63 | {
64 | "cell_type": "code",
65 | "metadata": {
66 | "id": "KUKG6fNMV_zf",
67 | "colab_type": "code",
68 | "cellView": "both",
69 | "colab": {
70 | "base_uri": "https://localhost:8080/",
71 | "height": 119
72 | },
73 | "outputId": "0c2336ce-5299-409e-f830-b68e83e00cfb"
74 | },
75 | "source": [
76 | "# Install R Packages\n",
77 | "install.packages('ggplot2')\n",
78 | "install.packages('dplyr')"
79 | ],
80 | "execution_count": 1,
81 | "outputs": [
82 | {
83 | "output_type": "stream",
84 | "text": [
85 | "Installing package into ‘/usr/local/lib/R/site-library’\n",
86 | "(as ‘lib’ is unspecified)\n",
87 | "\n",
88 | "Installing package into ‘/usr/local/lib/R/site-library’\n",
89 | "(as ‘lib’ is unspecified)\n",
90 | "\n"
91 | ],
92 | "name": "stderr"
93 | }
94 | ]
95 | },
96 | {
97 | "cell_type": "code",
98 | "metadata": {
99 | "id": "brr08aZX9Wss",
100 | "colab_type": "code",
101 | "colab": {
102 | "base_uri": "https://localhost:8080/",
103 | "height": 255
104 | },
105 | "outputId": "c1f8159d-e3a8-470b-e1b4-117be46a499f"
106 | },
107 | "source": [
108 | "# Load packages\n",
109 | "library(ggplot2)\n",
110 | "library(dplyr)"
111 | ],
112 | "execution_count": 2,
113 | "outputs": [
114 | {
115 | "output_type": "stream",
116 | "text": [
117 | "\n",
118 | "Attaching package: ‘dplyr’\n",
119 | "\n",
120 | "\n",
121 | "The following objects are masked from ‘package:stats’:\n",
122 | "\n",
123 | " filter, lag\n",
124 | "\n",
125 | "\n",
126 | "The following objects are masked from ‘package:base’:\n",
127 | "\n",
128 | " intersect, setdiff, setequal, union\n",
129 | "\n",
130 | "\n"
131 | ],
132 | "name": "stderr"
133 | }
134 | ]
135 | },
136 | {
137 | "cell_type": "code",
138 | "metadata": {
139 | "id": "9VJyZeEo9M4O",
140 | "colab_type": "code",
141 | "colab": {}
142 | },
143 | "source": [
144 | "# Get dataset\n",
145 | "airbnb = read.csv(\"https://github.com/datacamp/r-live-training-template/blob/master/data/airbnb.csv?raw=true\")"
146 | ],
147 | "execution_count": 0,
148 | "outputs": []
149 | }
150 | ]
151 | }
--------------------------------------------------------------------------------
/assets/datacamp.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # **Creating Dashboards in Shiny R** by **Ramnath Vaidyanathan**
2 |
3 | Live training sessions are designed to mimic the flow of how a real data scientist would address a problem or a task. As such, a session needs to have some “narrative” where learners are achieving stated learning objectives in the form of a real-life data science task or project. For example, a data visualization live session could be around analyzing a dataset and creating a report with a specific business objective in mind _(ex: analyzing and visualizing churn)_, a data cleaning live session could be about preparing a dataset for analysis etc ...
4 |
5 | As part of the 'Live training Spec' process, you will need to complete the following tasks:
6 |
7 | Edit this README by filling in the information for steps 1 - 4.
8 |
9 | ## Step 1: Foundations
10 |
11 | This part of the 'Live training Spec' process is designed to help guide you through session design by having you think through several key questions. Please make sure to delete the examples provided here for you.
12 |
13 | ### A. What problem(s) will students learn how to solve? (minimum of 5 problems)
14 |
15 | > _Here's an example from the Python for Spreadsheeets Users live session_
16 | >
17 | > - Key considerations to take in when transitioning from spreadsheets to Python.
18 | > - The Data Scientist mindset and keys to success in transitioning to Python.
19 | > - How to import `.xlsx` and `.csv` files into Python using `pandas`.
20 | > - How to filter a DataFrame using `pandas`.
21 | > - How to create new columns out of your DataFrame for more interesting features.
22 | > - Perform exploratory analysis of a DataFrame in `pandas`.
23 | > - How to clean a DataFrame using `pandas` to make it ready for analysis.
24 | > - Apply common spreadsheets operations such as pivot tables and vlookups in Python using `pandas`.
25 | > - Create simple, interesting visualizations using `matplotlib`.
26 |
27 |
28 | ### B. What technologies, packages, or functions will students use? Please be exhaustive.
29 |
30 | > - pandas
31 | > - matplotlib
32 | > - seaborn
33 |
34 | ### C. What terms or jargon will you define?
35 |
36 | _Whether during your opening and closing talk or your live training, you might have to define some terms and jargon to walk students through a problem you’re solving. Intuitive explanations using analogies are encouraged._
37 |
38 | > _Here's an example from the [Python for Spreadsheeets Users live session](https://www.datacamp.com/resources/webinars/live-training-python-for-spreadsheet-users)._
39 | >
40 | > - Packages: Packages are pieces of software we can import to Python. Similar to how we download, install Excel on MacOs, we import pandas on Python. (You can find it at minute 6:30)
41 |
42 | ### D. What mistakes or misconceptions do you expect?
43 |
44 | _To help minimize the amount of Q&As and make your live training re-usable, list out some mistakes and misconceptions you think students might encounter along the way._
45 |
46 | > _Here's an example from the [Data Visualization in Python live session](https://www.datacamp.com/resources/webinars/data-visualization-in-python)_
47 | >
48 | > - Anatomy of a matplotlib figure: When calling a matplotlib plot, a figure, axes and plot is being created behind the background. (You can find it at minute 11)
49 | > - As long as you do understand how plots work behind the scenes, you don't need to memorize syntax to customize your plot.
50 |
51 | ### E. What datasets will you use?
52 |
53 | Live training sessions are designed to walk students through something closer to a real-life data science workflow. Accordingly, the dataset needs to accommodate that user experience.
54 | As a rule of thumb, your dataset should always answer yes to the following question:
55 | > Is the dataset/problem I’m working on, something an industry data scientist/analyst could work on?
56 |
57 | Check our [datasets to avoid](https://instructor-support.datacamp.com/en/articles/2360699-datasets-to-avoid) list.
58 |
59 | ## Step 2: Who is this session for?
60 |
61 | Terms like "beginner" and "expert" mean different things to different people, so we use personas to help instructors clarify a live training's audience. When designing a specific live training, instructors should explain how it will or won't help these people, and what extra skills or prerequisite knowledge they are assuming their students have above and beyond what's included in the persona.
62 |
63 | - [ ] Please select the roles and industries that align with your live training.
64 | - [ ] Include an explanation describing your reasoning and any other relevant information.
65 |
66 | ### What roles would this live training be suitable for?
67 |
68 | *Check all that apply.*
69 |
70 | - [ ] Data Consumer
71 | - [ ] Leader
72 | - [ ] Data Analyst
73 | - [ ] Citizen Data Scientist
74 | - [ ] Data Scientist
75 | - [ ] Data Engineer
76 | - [ ] Database Administrator
77 | - [ ] Statistician
78 | - [ ] Machine Learning Scientist
79 | - [ ] Programmer
80 | - [ ] Other (please describe)
81 |
82 | ### What industries would this apply to?
83 |
84 | *List one or more industries that the content would be appropriate for.*
85 |
86 |
87 | ### What level of expertise should learners have before beginning the live training?
88 |
89 | *List three or more examples of skills that you expect learners to have before beginning the live training*
90 |
91 | > - Can draw common plot types (scatter, bar, histogram) using matplotlib and interpret them
92 | > - Can run a linear regression, use it to make predictions, and interpret the coefficients.
93 | > - Can calculate grouped summary statistics using SELECT queries with GROUP BY clauses.
94 |
95 |
96 | ## Step 3: Prerequisites
97 |
98 | List any prerequisite courses you think your live training could use from. This could be the live session’s companion course or a course you think students should take before the session. Prerequisites act as a guiding principle for your session and will set the topic framework, but you do not have to limit yourself in the live session to the syntax used in the prerequisite courses.
99 |
100 |
101 | ## Step 4: Session Outline
102 |
103 | A live training session usually begins with an introductory presentation, followed by the live training itself, and an ending presentation. Your live session is expected to be around 2h30m-3h long (including Q&A) with a hard-limit at 3h30m. You can check out our live training content guidelines [here](_LINK_).
104 |
105 |
106 | > _Example from [Python for Spreadsheet Users](https://www.datacamp.com/resources/webinars/live-training-python-for-spreadsheet-users)_
107 | >
108 | > ### Introduction Slides
109 | > - Introduction to the webinar and instructor (led by DataCamp TA)
110 | > - Introduction to the topics
111 | > - Discuss need to become data fluent
112 | > - Define data fluency
113 | > - Discuss how learning Python fits into that and go over session outline
114 | > - Set expectations about Q&A
115 | >
116 | > ### Live Training
117 | > #### Exploratory Data Analysis
118 | > - Import data and print header of DataFrame `pd.read_excel()`, `.head()`
119 | > - Glimpse at the data to
120 | > - Get column types using `.dtypes`
121 | > - Use `.describe()`, `.info()`
122 | > - **Q&A**
123 | > #### Data Cleaning and making it ready for analysis
124 | > - Convert date columns to datetime `pd.to_datetime()`
125 | > - Change column names
126 | > - Extract year, month from datetime `.strftime()`
127 | > - Drop an irrelevant column `.drop()`
128 | > - Fill missing values with `.fillna()`
129 | > #### Creating a report
130 | > - First report question: What is our overall sales performance this year? `.groupby()`, `.plt.plot()`
131 | > - Second report question: What is our overall sales performance this year? `.merge()`, `.groupby()`, `plt.plot()`
132 | > - Third report question: What is our overall sales performance this year? `.merge()`, `.groupby()`, `plt.plot()`
133 | > - **Q&A**
134 | >
135 | > ### Ending slides
136 | > - Recap of what we learned
137 | > - The data science mindset
138 | > - Call to action and course recommendations
139 |
140 | ## Authoring your session
141 |
142 | To get yourself started with setting up your live session, follow the steps below:
143 |
144 | 1. Download and install the "Open in Colabs" extension from [here](https://chrome.google.com/webstore/detail/open-in-colab/iogfkhleblhcpcekbiedikdehleodpjo?hl=en). This will let you take any jupyter notebook you see in a GitHub repository and open it as a **temporary** Colabs link.
145 | 2. Upload your dataset(s) to the `data` folder.
146 | 3. Upload your images, gifs, or any other assets you want to use in the notebook in the `assets` folder.
147 | 4. Check out the notebooks templates in the `notebooks` folder, and keep the template you want for your session while deleting all remaining ones.
148 | 5. Preview your desired notebook, press on "Open in Colabs" extension - and start developing your content in colabs _(which will act as the solution code to the session)_. :warning: **Important** :warning: Your progress will **not** be saved on Google Colabs since it's a temporary link. To save your progress, make sure to press on `File`, `Save a copy in GitHub` and follow remaining prompts. You can also download the notebook locally and develop the content there as long you test out that the syntax works on Colabs as well.
149 | 6. Once your notebooks is ready to go, give it the name `session_name_solution.ipynb` create an empty version of the Notebook to be filled out by you and learners during the session, end the file name with `session_name_learners.ipynb`.
150 | 7. Create Colabs links for both sessions and save them in notebooks :tada:
151 |
--------------------------------------------------------------------------------