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-63bf3a78{}.cl-63b59676{font-family:'Arial';font-size:11pt;font-weight:normal;font-style:normal;text-decoration:none;color:rgba(0, 0, 0, 1.00);background-color:transparent;}.cl-63b8fd84{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-63b9136e{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-63b9136f{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-63b91378{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-63b91379{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-63b91382{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-63b91383{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-63b9138c{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-63b9138d{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-63b9138e{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-63b91396{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-63b91397{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-63b913a0{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-63b913a1{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-63b913a2{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-63b913aa{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-63bf3a78'><thead><tr style="overflow-wrap:break-word;"><th class="cl-63b9136e"><p class="cl-63b8fd84"><span class="cl-63b59676">Time</span></p></th><th class="cl-63b9136f"><p class="cl-63b8fd84"><span class="cl-63b59676">Location</span></p></th><th class="cl-63b91378"><p class="cl-63b8fd84"><span class="cl-63b59676">Topic</span></p></th></tr></thead><tbody><tr style="overflow-wrap:break-word;"><td class="cl-63b91379"><p class="cl-63b8fd84"><span class="cl-63b59676">25 minutes</span></p></td><td class="cl-63b91382"><p class="cl-63b8fd84"><span class="cl-63b59676">Main</span></p></td><td class="cl-63b91383"><p class="cl-63b8fd84"><span class="cl-63b59676">Introduction to reprex</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-63b9138c"><p class="cl-63b8fd84"><span class="cl-63b59676">2 hours 45 mins</span></p></td><td class="cl-63b9138d"><p class="cl-63b8fd84"><span class="cl-63b59676">Breakouts</span></p></td><td class="cl-63b9138e"><p class="cl-63b8fd84"><span class="cl-63b59676">Common errors; reprex post</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-63b91396"><p class="cl-63b8fd84"><span class="cl-63b59676">20 minutes</span></p></td><td class="cl-63b91397"><p class="cl-63b8fd84"><span class="cl-63b59676">Main</span></p></td><td class="cl-63b913a0"><p class="cl-63b8fd84"><span class="cl-63b59676">Recap</span></p></td></tr></tbody><tfoot><tr style="overflow-wrap:break-word;"><td colspan="3"class="cl-63b913a1"><p class="cl-63b8fd84"><span class="cl-63b59676">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://appliedepi.org/community/) * [ChatGPT](https://chat.openai.com/auth/login) or other AI resources * [Google search](google.com), [Stackoverflow](https://stackoverflow.com/), or [Stackexchange](https://stackexchange.com/) * [Applied Epi Help Desk](support.appliedepi.org) ( 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.