class: center, middle, inverse, title-slide <style type="text/css"> .remark-slide table{ border: none } .remark-slide-table { } tr:first-child { border-top: none; } tr:last-child { border-bottom: none; } </style> # Introduction to R for Applied Epidemiology ### Error troubleshooting and getting help contact@appliedepi.org --- # Today: objectives & schedule **In this module we aim to help you:** * Understand how to get help with your code -- * Review common error codes and how to solve them -- * Learn about help documentation and other resources for code help -- * Post a "reprex" (reproducible example) of an error in the Applied Epi Community Forum <div class="tabwid"><style>.cl-08681444{}.cl-08646128{font-family:'Helvetica';font-size:11pt;font-weight:normal;font-style:normal;text-decoration:none;color:rgba(0, 0, 0, 1.00);background-color:transparent;}.cl-0865ee94{margin:0;text-align:left;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 1;background-color:transparent;}.cl-0865fed4{width:1.372in;background-color:transparent;vertical-align: middle;border-bottom: 1.5pt solid rgba(102, 102, 102, 1.00);border-top: 1.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-0865fed5{width:0.973in;background-color:transparent;vertical-align: middle;border-bottom: 1.5pt solid rgba(102, 102, 102, 1.00);border-top: 1.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-0865fef2{width:2.196in;background-color:transparent;vertical-align: middle;border-bottom: 1.5pt solid rgba(102, 102, 102, 1.00);border-top: 1.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-0865fef3{width:1.372in;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-0865ff06{width:0.973in;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-0865ff10{width:2.196in;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-0865ff24{width:1.372in;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-0865ff2e{width:0.973in;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-0865ff38{width:2.196in;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-0865ff42{width:1.372in;background-color:transparent;vertical-align: middle;border-bottom: 1.5pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-0865ff43{width:0.973in;background-color:transparent;vertical-align: middle;border-bottom: 1.5pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-0865ff56{width:2.196in;background-color:transparent;vertical-align: middle;border-bottom: 1.5pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-0865ff60{width:1.372in;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(255, 255, 255, 0.00);border-top: 0 solid rgba(255, 255, 255, 0.00);border-left: 0 solid rgba(255, 255, 255, 0.00);border-right: 0 solid rgba(255, 255, 255, 0.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-0865ff74{width:0.973in;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(255, 255, 255, 0.00);border-top: 0 solid rgba(255, 255, 255, 0.00);border-left: 0 solid rgba(255, 255, 255, 0.00);border-right: 0 solid rgba(255, 255, 255, 0.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-0865ff88{width:2.196in;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(255, 255, 255, 0.00);border-top: 0 solid rgba(255, 255, 255, 0.00);border-left: 0 solid rgba(255, 255, 255, 0.00);border-right: 0 solid rgba(255, 255, 255, 0.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}</style><table data-quarto-disable-processing='true' class='cl-08681444'><thead><tr style="overflow-wrap:break-word;"><th class="cl-0865fed4"><p class="cl-0865ee94"><span class="cl-08646128">Time</span></p></th><th class="cl-0865fed5"><p class="cl-0865ee94"><span class="cl-08646128">Location</span></p></th><th class="cl-0865fef2"><p class="cl-0865ee94"><span class="cl-08646128">Topic</span></p></th></tr></thead><tbody><tr style="overflow-wrap:break-word;"><td class="cl-0865fef3"><p class="cl-0865ee94"><span class="cl-08646128">25 minutes</span></p></td><td class="cl-0865ff06"><p class="cl-0865ee94"><span class="cl-08646128">Main</span></p></td><td class="cl-0865ff10"><p class="cl-0865ee94"><span class="cl-08646128">Introduction to reprex</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-0865ff24"><p class="cl-0865ee94"><span class="cl-08646128">2 hours 45 mins</span></p></td><td class="cl-0865ff2e"><p class="cl-0865ee94"><span class="cl-08646128">Breakouts</span></p></td><td class="cl-0865ff38"><p class="cl-0865ee94"><span class="cl-08646128">Common errors; reprex post</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-0865ff42"><p class="cl-0865ee94"><span class="cl-08646128">20 minutes</span></p></td><td class="cl-0865ff43"><p class="cl-0865ee94"><span class="cl-08646128">Main</span></p></td><td class="cl-0865ff56"><p class="cl-0865ee94"><span class="cl-08646128">Recap</span></p></td></tr></tbody><tfoot><tr style="overflow-wrap:break-word;"><td colspan="3"class="cl-0865ff60"><p class="cl-0865ee94"><span class="cl-08646128">Take breaks as you wish during the exercise</span></p></td></tr></tfoot></table></div> --- # Introduction to reprex Today we want to focus on **how to get help** with R code There are many ways to get help beyond the course! * [Applied Epi R Handbook](https://epirhandbook.com/en/) * [Applied Epi Community Forum](https://community.appliedepi.org/) * [ChatGPT](https://chatgpt.com/) or other AI resources * [Google search](https://www.google.com/), [Stackoverflow](https://stackoverflow.com/), or [Stackexchange](https://stackexchange.com/) * [Applied Epi Help Desk](https://appliedepi.org/support/support.html) (you will receive coupons upon course completion) For many of the search options, it is important to understand how to make a reproducible example. --- # Introduction to reprex What is a reproducible example (**reprex**)? * Summarise a problem so readers can re-create it on their own computers * Should be **minimal**: * Include only data and code required to produce the problem * Should be **reproducible**: * Include *all* context required to reproduce the problem * E.g. packages, simplified dataframe, commands, R version used, etc. We will go through a demonstration of how to create and post a reprex. Don't feel like you have to type along! You will have the opportunity to create your own in the exercises. --- class: inverse, center, middle # Demo: How to make a reprex <img src="../../images/breakout/window.png" width="50%" /> --- # This session Today's session is split into parts: **Common errors and getting help** * Examples of common errors - can you debug them? * The quiz is to teach you how to understand common errors **Creating reprexes using the ebola analysis** * You will have the opportunity to create two reprex examples * Make sure to post them in the **Training** area for today! Remember, we are here to help, no matter where you are in the exercise. --- # Exercise! * Go to the course website * Open the exercise for Module 6, and login * Follow the exercise to review common errors and answer quiz questions * Learn about how to get help from different resources * Create a reprex in the Applied Epi Community Forum on the Training page * Let an instructor know if you are unsure what to do We will recap at the end of the session.