Defensive R Programming
Learn defensive programming in R to make your code more robust.
Comienza El Curso Gratis4 horas16 vídeos51 ejercicios4585 aprendicesDeclaración de cumplimiento
Crea Tu Cuenta Gratuita
o
Al continuar, acepta nuestros Términos de uso, nuestra Política de privacidad y que sus datos se almacenan en los EE. UU.¿Entrenar a 2 o más personas?
Probar DataCamp for BusinessPreferido por estudiantes en miles de empresas
Descripción del curso
Writing R scripts is easy. Writing good R code is hard. In this course, we'll discuss defensive programming - a set of standard techniques that will help reduce bugs and aid working in teams. We examine techniques for avoiding common errors and also how to handle the inevitable error that arises in our code. The course will conclude looking at when to make the transition from script to project to package.
¿Entrenar a 2 o más personas?
Obtén a tu equipo acceso a la plataforma DataCamp completa, incluidas todas las funciones.En las siguientes pistas
Desarrollador R
Ir a la pista- 1
Avoiding Conflict
GratuitoIn this first chapter, you'll learn what defensive programming is, and how to use existing packages for increased efficiency. You will then learn to manage the packages loaded in your environment and the potential conflicts that may arise.
- 2
Early warning systems
Programming is simpler when you get feedback on your code execution. In R, we use messages, warnings and errors to signal to keep the user informed. This chapter will discuss when and where you should use these communication tools.
Early warning systems50 xpTo TRUE or not to T50 xpLet's be evil100 xpIf it weren't for those pesky kids50 xpMessage in a bottle50 xpDid you get the message?50 xpSuppressing startup messages100 xpStop being noisy!!!100 xpUsing message in practice100 xpYou have been warned50 xpMessages vs Warnings50 xpSuppressing warnings100 xpStop (right now)50 xpWarnings vs Stop50 xpUsing the stop() function100 xp - 3
Preparing your defenses
We can avoid making mistakes using a consistent programming approach. In this chapter, we will introduce you to R best practices.
Preparing your defences50 xpWhat does DRY mean?50 xpRefactoring: functions100 xpJust one comment50 xpHeader comments100 xpA little bit dotty50 xpUse a full stop in variable names50 xpAvoiding the .100 xpCoding Style50 xpImportance of consistent style50 xpStatic Code Analysis for R50 xpCode tidying100 xpMore linting100 xp - 4
Creating a Battle Plan
Creating a script is nice, but working on a project with several scripts and assets requires structure. This final chapter will teach you good organization practices, so you can go from script to package with an optimal workflow.
A battle plan50 xpThe importance of consistency50 xpGive me some space50 xpHuman readable filenames50 xpWhat date format should we use?50 xpOrganizing a project50 xpAvoiding absolute directories50 xpThe input/ directory50 xpAbsolute vs relative100 xpGraphics and output50 xpGenerating graphics50 xpGraphics/100 xpOne final work flow100 xp
¿Entrenar a 2 o más personas?
Obtén a tu equipo acceso a la plataforma DataCamp completa, incluidas todas las funciones.En las siguientes pistas
Desarrollador R
Ir a la pistacolaboradores
requisitos previos
Intermediate RColin Gillespie
Ver MásAssoc Prof at Newcastle University, Consultant at Jumping Rivers
¿Qué tienen que decir otros alumnos?
¡Únete a 15 millones de estudiantes y empieza Defensive R Programming hoy mismo!
Crea Tu Cuenta Gratuita
o
Al continuar, acepta nuestros Términos de uso, nuestra Política de privacidad y que sus datos se almacenan en los EE. UU.