Giter VIP home page Giter VIP logo

Comments (8)

maurolepore avatar maurolepore commented on September 21, 2024

@gonzalezeb

Please review the documentation of each exported dataset. Although the exported datasets live in data/, their documentation lives in R/data.R. You seem to have already written some useful information that now lives in data-raw/data.Rmd. I suggest you remove duplication: Document each dataset in R/data.R and then simply cite that documentation elsewhere. For example, if in data-raw/data.Rmd you want to provide details about the dataset equations, don't write those details directly; instead point to the help file of equations by writing "see ?equations". If this is unclear, let me know.

You may edit the skeleton that I wrote; later I can edit your work to apply roxygen2 syntax (which is the easiest way to create R help-files). FYI, here is a short explanation about how to document data -- althought it is a little out of date and now writing documentation is much easier because roxygen2 supports rmarkdown syntax (see this article).


You will notice that I documented each dataset and its correspoinding dataset_metadata in way that makes them appear in the same help-file. That way a single help file (accessed with any of ?dataset or ?dataset_metadata) explains what those two closely related datasets mean. The approach I am using uses the roxygen2 tags @name and @rdname; you can find more information about this approach here (although it refers to functions and not datasets, it works in the same way for both).

from allodb.

maurolepore avatar maurolepore commented on September 21, 2024

Here are some resources for inspiration about how to document datasets.

# Comes by default with R
?datasets::airquality

# install.packages("ggplot2")
?ggplot2::diamonds

install.packages("gapminder")
?gapminder::gapminder
# To see other datasets in the gapminder package type gampinder:: and then hit tab

from allodb.

gonzalezeb avatar gonzalezeb commented on September 21, 2024

Just tried to improve documentation but got stuck with my lack of skills (ie. how to built a table that will go under 'Format' when calling ?equations...)..We can work on this later.

from allodb.

maurolepore avatar maurolepore commented on September 21, 2024

There is the roxygen tag @format. IT would look like this:

#' @format 
#' stuff

But I haven't used @format a lot so I'm unsure what you can and can't do in it. Can I see the table you want to add?

from allodb.

gonzalezeb avatar gonzalezeb commented on September 21, 2024

I want equation_metadata to look like the table in ?datasets::airquality when using the help file for ?equation

I tried something in commit 1cafffb, but nothing happened

from allodb.

maurolepore avatar maurolepore commented on September 21, 2024
#' Tables of allometric equations and associated metadata for ForestGEO sites.
#'
#' A dataset of best available allometry equations to calculate AGB per species
#' per ForestGEO site:
#' * `equations`: Table of allometric equations.
#' * `equations_metadata`: Table of metadata of `equations`.
#'
#' @details
#' A data frame with 154 observations on 6 variables.
#' @details
#' ```
#' [,1]	Ozone	 numeric	 Ozone (ppb)
#' [,2]	Solar.R	 numeric	 Solar R (lang)
#' [,3]	Wind	 numeric	 Wind (mph)
#' [,4]	Temp	 numeric	 Temperature (degrees F)
#' [,5]	Month	 numeric	 Month (1--12)
#' [,6]	Day	 numeric	 Day of month (1--31)
#' ```
"equations"

#' @rdname equations
"equations_metadata"

image

from allodb.

maurolepore avatar maurolepore commented on September 21, 2024

I'll push tihis one.

#' Tables of allometric equations and associated metadata for ForestGEO sites.
#'
#' A dataset of best available allometry equations to calculate AGB per species
#' per ForestGEO site:
#' * `equations`: Table of allometric equations.
#' * `equations_metadata`: Table of metadata of `equations`.
#'
#' @format
#' A data frame with 154 observations on 6 variables.
#' ```
#' [,1]	Ozone	 numeric	 Ozone (ppb)
#' [,2]	Solar.R	 numeric	 Solar R (lang)
#' [,3]	Wind	 numeric	 Wind (mph)
#' [,4]	Temp	 numeric	 Temperature (degrees F)
#' [,5]	Month	 numeric	 Month (1--12)
#' [,6]	Day	 numeric	 Day of month (1--31)
#' ```
"equations"

image

from allodb.

gonzalezeb avatar gonzalezeb commented on September 21, 2024

Closing (finally!) because all functions and datasets have been documented

from allodb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.