Skip to content
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 documentation - Brainstorm #11

Open
AndersAskeland opened this issue Mar 17, 2024 · 0 comments
Open

Function documentation - Brainstorm #11

AndersAskeland opened this issue Mar 17, 2024 · 0 comments
Assignees

Comments

@AndersAskeland
Copy link
Member

AndersAskeland commented Mar 17, 2024

Previous section

The preceding section is: sessions/function-development.qmd.

In this section, participants learn how to create functions that can be incorporated into R package.

Learning outcome

Overarching goal

  • Learn why and how one document R functions utilizing {roxygen2}.

Sub goals

  • Understand why function documentation is crucial for a package (exercise 1).
  • Learn to document functions using {roxygen2} (exercise 2).
  • Learn how to write and create examples within documentation (exercise 3).
  • Familiarize with and apply various Roxygen tags (exercise 4).

Exercises

During exercise, improve previously written functions with what is learned.

Exercise 1 - The Importance of Documentation

Discuss why detailed documentation is vital. Focus on its impact on code readability, maintenance, and collaboration.

Exercise 2 - Documenting Functions with {roxygen2}

  • Introduce the basics of using Roxygen for function documentation, covering essential aspects like the function's purpose, parameters (@param), return values (@return), and how to make a function available to users (@export).
  • Explain export and when to use it.

Exercise 3 - Writing Effective Examples

  • Learn about creating examples
  • I am unsure: Is this not also used in/as unit testing?

Exercise 4 - Additional Roxygen Tags to Know

  • Learn about additional Rozygen tags (reading exercise?)
    • @seealso: For linking related documentation or resources.
    • @family: To group related functions within the documentation.
    • @references: For adding citations to external sources or literature.
    • @note: To provide additional context or information.
    • @warnings: To alert users about any potential caveats or issues.
    • @inheritParams

Next...

??? Is it debugging?

@AndersAskeland AndersAskeland changed the title Function development - Section 2: First steps Function development - Paragraph 2: First steps Mar 17, 2024
@AndersAskeland AndersAskeland self-assigned this Mar 17, 2024
@AndersAskeland AndersAskeland changed the title Function development - Paragraph 2: First steps Function documentation - Brainstorm Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

1 participant