Defensive R Programming
Learn defensive programming in R to make your code more robust.
Kurs Kostenlos Starten4 Stunden16 Videos51 Übungen4.591 LernendeLeistungsnachweis
Kostenloses Konto erstellen
oder
Durch Klick auf die Schaltfläche akzeptierst du unsere Nutzungsbedingungen, unsere Datenschutzrichtlinie und die Speicherung deiner Daten in den USA.Trainierst du 2 oder mehr?
Versuchen DataCamp for BusinessBeliebt bei Lernenden in Tausenden Unternehmen
Kursbeschreibung
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.
Trainierst du 2 oder mehr?
Verschaffen Sie Ihrem Team Zugriff auf die vollständige DataCamp-Plattform, einschließlich aller Funktionen.In den folgenden Tracks
R Entwickler
Gehe zu Track- 1
Avoiding Conflict
KostenlosIn 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
Trainierst du 2 oder mehr?
Verschaffen Sie Ihrem Team Zugriff auf die vollständige DataCamp-Plattform, einschließlich aller Funktionen.In den folgenden Tracks
R Entwickler
Gehe zu TrackMitwirkende
Voraussetzungen
Intermediate RColin Gillespie
Mehr AnzeigenAssoc Prof at Newcastle University, Consultant at Jumping Rivers
Was sagen andere Lernende?
Melden Sie sich an 15 Millionen Lernende und starten Sie Defensive R Programming Heute!
Kostenloses Konto erstellen
oder
Durch Klick auf die Schaltfläche akzeptierst du unsere Nutzungsbedingungen, unsere Datenschutzrichtlinie und die Speicherung deiner Daten in den USA.