In this video you'll learn how to make your own functions, which will make your code much more readable and easy to edit, and will help you to avoid mistakes. I will cover the syntax of creating functions, as well as general concepts and philosophy that you should follow. You will even learn how to make your own custom error messages, which should be more helpful than the error messages you typically see.
Dataset for the tutorial: https://github.com/lvclark/R_Python_v...
Video on indexing, for one of the exercises: • Python and R #1.2: Indexing and slicing
I was super pregnant while recording this one, so apologies for being out of breath and even more nasal than usual.
Table of Contents:
00:00 - Programming with Python and R #1.4: Making your own functions
00:08 - Learning objectives
01:37 - Reminders
02:21 - Abstraction
04:54 - Creating your own functions
06:19 - Components of a function definition
07:27 - Simple function in Python
14:53 - Simple functions in R
19:14 - Exercise
24:07 - Variable scope
30:27 - Quick exercise
31:07 - A more complex example
34:17 - Setting argument defaults
38:32 - Documenting functions
41:51 - Exercise
54:29 - Adding error messages
58:43 - Putting functions into separate files
1:04:29 - NSF Acknowledgement
On this page of the site you can watch the video online Python and R #1.4: Making functions with a duration of hours minute second in good quality, which was uploaded by the user Programming and Linear Algebra for Biologists 16 November 2019, share the link with friends and acquaintances, this video has already been watched 6 times on youtube and it was liked by 1 viewers. Enjoy your viewing!