FlukeAndFeather / jese4sci-DOC

Documentation track of the jese4sci short course
0 stars 0 forks source link

DOC201 #16

Closed ShirleyJenniferSerranoRojas closed 2 years ago

ShirleyJenniferSerranoRojas commented 2 years ago
  1. Rule 2 from Lee (2018) was "Include examples (and lots of them)". This is common advice in software documentation. What roxygen keyword would you use to include examples with your API documentation? @examples provides executable R code showing how to use the function in practice

  2. What roxygen keywords would you use to document function inputs and outputs? @param name description describes the function’s inputs or parameters @return description describes the output from the function

  3. What's the RStudio shortcut for inserting a roxygen skeleton? What's the Rstudio shortcut for compiling documentation? Build & Reload in the build pane in R studio is the shortcut to insert a roxygen skeleton. devtools::document() is used to compile the documentation

Critique roxygen comments Pick an R function that's important to your work. https://github.com/tidyverse/dplyr/blob/main/R/group-by.r How does the API documentation address the following? • What are the inputs and outputs? Imputs: @param ... In group_by(), variables or computations to group by. @param .add When FALSE, the default, group_by() will override existing groups. @param .drop Drop groups formed by factor levels that don't appear in the data.

Outputs: @return A grouped data frame with class [grouped_df][grouped_df] The inputs don’t have enough information on the variable type or the limit size. The output is clearer as it indicates the output class that will be returned (df), but there are no limit sizes. Despite not having more details the use of the group_by() function is straightforward.

• Are there examples? Are they runnable? Do they require any external data? If so, how is that handled?

Yes, there are many examples that show how the function computes the grouping of the data, how the output behaves with other functions from the Dplyr package, how to remove grouping, how it overrides existing groups, how to group by expressions, etc. It requires external data to run the examples, but the function file does not explain the data that is being used in the example

https://github.com/ShirleyJenniferSerranoRojas/simplerc.git

mcgoodman commented 2 years ago

Hey Shirley - looks great, just a couple comments:

You can close the issue once you've read this comment!

ShirleyJenniferSerranoRojas commented 2 years ago

Thank you