The class checkers (chk_s3_class(), chk_s3_class_strict(), chk_s4_class(), chk_r6_class(), chk_is()) implement two conventions that are only partially documented:
- R5 (reference) classes count as S4, because
isS4() is TRUE for them.
- Base objects and S7 classes count as S3 for
chk_s3_class() (S7 objects are excluded by chk_s3_class_strict()).
These are recorded in a code comment (R/internal.R:21) but are not stated consistently in the user-facing documentation.
Gaps to review:
chk_s3_class() documents the base-object / S7 convention but does not mention that R5 reference classes are treated as S4 and so fail the check.
chk_s3_class_strict() has no @details note at all, despite excluding S7 objects (via !inherits(x, "S7_object")) as well as R5.
chk_s4_class() does not mention that R5 reference classes satisfy the check.
vignette("chk-families") describes the S3/S4/R6 checkers without covering either convention, and the formula shown for chk_s3_class() omits the !inherits(x, "R6") term that is in the actual implementation.
Proposed: add a shared @details block (or a documented note reused via @inherit) covering both conventions, apply it across the class checkers, and update the vignette section, including correcting the formulas shown there.
Related to #254.
The class checkers (
chk_s3_class(),chk_s3_class_strict(),chk_s4_class(),chk_r6_class(),chk_is()) implement two conventions that are only partially documented:isS4()isTRUEfor them.chk_s3_class()(S7 objects are excluded bychk_s3_class_strict()).These are recorded in a code comment (
R/internal.R:21) but are not stated consistently in the user-facing documentation.Gaps to review:
chk_s3_class()documents the base-object / S7 convention but does not mention that R5 reference classes are treated as S4 and so fail the check.chk_s3_class_strict()has no@detailsnote at all, despite excluding S7 objects (via!inherits(x, "S7_object")) as well as R5.chk_s4_class()does not mention that R5 reference classes satisfy the check.vignette("chk-families")describes the S3/S4/R6 checkers without covering either convention, and the formula shown forchk_s3_class()omits the!inherits(x, "R6")term that is in the actual implementation.Proposed: add a shared
@detailsblock (or a documented note reused via@inherit) covering both conventions, apply it across the class checkers, and update the vignette section, including correcting the formulas shown there.Related to #254.