swcarpentry / r-novice-inflammation

Programming with R
http://swcarpentry.github.io/r-novice-inflammation/
Other
163 stars 395 forks source link

Diagrams to describe functions #486

Closed karenword closed 7 months ago

karenword commented 4 years ago

The following was submitted by email as a contribution for checkout:

"As part of my checkout process, I would like to make a contribution to Programming with R - Creating Functions, by adding a diagram to describe functions (svg and png files are attached). For the novice, even after seeing how a function works, it can be difficult to understand what components are doing what, and what needs to be changed when creating a new function. Hopefully the image below will help with that.

Below is a visual representation of different components of a function. When creating a new function, one can define the following components a: 1) function name, 2) function argument(s), and 3) function body."

https://drive.google.com/file/d/1f29zR5WJW_Ie3FSZeUTSY8-ar15RCqd1/view?usp=sharing

https://drive.google.com/file/d/1y6ZgUwFw9XJV-57lgpfsqhpqWJRFYWqH/view?usp=sharing

C-CAB commented 4 years ago

I think this is a good idea to include in the the lesson plan or as some form of supplementary material. Having a static image that connects terms to examples helps explain the definitions and can provide a great reference for people to come back to. I think this would be a good idea to expand upon with other terms early on in lessons.

HaoZeke commented 3 years ago

This is fantastic, I've been using Jamboard to draw precisely this. It'd be great to have a PR for this change.