-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Function Development - Brainstorm #10
Comments
Consider using |
Is there a need for participants to learn about breaks ( Don't see any real use for it as such (in the scope of the exercises), but could perhaps be a extra reading task or a reference? |
Great quote related to complex functions: "When I look at that function signature I hear the screams of matrices being ground to a fine powder of bits through the conical burrs of nested for loops, and laboured index arithmetic." https://www.milesmcbain.com/posts/data-analysis-reuse/ |
Idea for a section/anti-session: "One function to rule them all" |
Quote: "Packages are a way of describing and distributing functions in a structured and consistent way." |
Exercise 5 - Give an unsupported variable to function, and see error. It is not easy to know what it means |
I don't know why I wasn't shown these notifications 🤔. In relation to your question about break etc, I agree, I don't think that's necessary. |
Previous section
The preceding section is:
sessions/package-setup.qmd
.During this section, participants learn about setting up and preparing the R environment for creating packages.
Learning outcome
Overarching goal
Sub goals
Exercises
The following exercises are designed to develop a comprehensive understanding of function development in relation to R package creation. The order should be adjusted based on the flow of the course.
Exercise 1 - Write Code/Script
Objective: Write a script that addresses a specific problem, showcasing the practical application of R code.
Note: If previous sections create functions/code - use this.
Exercise 2 - Rewrite Code into a Function
Objective: Convert the given script into a function.
Exercise 3 - Abstractions
Objective: Evolve the function by abstracting the action of extracting elements, enhancing its flexibility and reusability.
Exercise 4 - Dependency Management
Objective: Learn to accurately declare and manage package dependencies.
Imports
,Depends
, andSuggests
in the DESCRIPTION file.Exercise 5 - Error Handling/Control Flow
Objective: Incorporate error checking and control structures within functions.
stop()
,warning()
, andmessage()
for providing feedback at various levels.For example:
Extra Exercise - Extending Generic Functions
Optional Reading
Next Section
Documentation
The text was updated successfully, but these errors were encountered: