chk icon indicating copy to clipboard operation
chk copied to clipboard

Potential functions to add to `chk` (first version of the diagram)

Open flor14 opened this issue 1 year ago • 0 comments

Hello

Here there is a first version of chk diagram. Part of the diagram is based on the book Advanced R.

The existence of objects mentioned in Advanced R that do not currently have a corresponding chk function should not be the sole criterion for deciding which new functions to include in the package. The goal of this issue is to list these objects as sources of potential new chk functions for further discussion.

Both the diagram and the final comments are open to feedback and modifications.

image

Note: The functions highlighted in pink may be confusing. I marked them this way to remind myself to add some clarifying comments in the documentation.

What is currently not covered?

  • The data types complex and raw don't have specific functions to check them (but they are mentioned as less frequently used).
  • Tibbles. There are no chk_* and vld_* functions for tibbles. Tibbles are not equal to data frames. They have a different class and can behave as specified in this section of Advanced R
#> $class
#> [1] "tbl_df"     "tbl"        "data.frame"
  • Durations. There are no chk_* and vld_* functions for class difftimes.

"Durations, which represent the amount of time between pairs of dates or date-times, are stored in difftime. difftime class is built on top of doubles, and have a units attribute that determines how the value should be interpreted"

  • Units attribute Since the chk_tz function checks the tz attribute of the POSIXct class, a similar chk_* and vld_* function could be developed to check the units attribute of the difftime class.

  • Double data type scalars There are some scalars for data type double that don't have specific functions to check them: hexadecimal, NaN, Inf, -Inf, Scientific.

  • More functions for data.frames length() may not be intuitive for data.frames.

"A data frame has nrow() rows and ncol() columns. The length() of a data frame gives the number of columns."

flor14 avatar Oct 09 '24 21:10 flor14