---
layout: post
title: "A tutorial for writing functions in R (CC177)"
blurb: "Nearly everything you need to know to start writing functions"
author: "PD Schloss"
date: 2022-01-10 11:00
comments: false
youtube: 3uK1OzA7CTs
start_hash: 8d53a5fa3c4da2e8d36f3d6e51279465ef0663dc
end_hash: f95509595c134b11e3cef89c3e151007462f7ae8
---

Writing your own R functions is critical to expanding the versatility and reproducibility of your code. In this epsiode Pat shares almost everything you'd ever want to know about writing your own R functions and then applies this knowledge to adapt the code he's been writing in this series into a function. This is part of a series of videos demonstrating how to functions from base R to make these data compatible with tools from the tidyverse


<iframe style="margin: 0 auto;display:block;" width="560" height="315" src="https://www.youtube.com/embed/{{ page.youtube }}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>


## Code

You can browse the state of the repository at the
* [beginning of the episode](https://github.com/riffomonas/distances/tree/{{ page.start_hash }})
* [end of the episode](https://github.com/riffomonas/distances/tree/{{ page.end_hash }})
