From 04adde41af6dbd2a4708291fe549a4e7160b40d5 Mon Sep 17 00:00:00 2001 From: yun Date: Wed, 8 Nov 2023 13:29:21 +0800 Subject: [PATCH] add prototype for year and quarter --- R/class-FAERS.R | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/R/class-FAERS.R b/R/class-FAERS.R index aeb2f50..f498472 100644 --- a/R/class-FAERS.R +++ b/R/class-FAERS.R @@ -54,6 +54,8 @@ methods::setClass( format = "character" ), prototype = list( + year = integer(), + quarter = character(), data = NULL, meddra = NULL, deduplication = FALSE, @@ -61,9 +63,7 @@ methods::setClass( ) ) -## Validator for FAERS - -################ utils methods ######################## +################ validate method ######################## validate_faers <- function(object) { if (length(object@year) != length(object@quarter)) { return("the length of `@year` and `@quarter` must be the same") @@ -135,6 +135,7 @@ methods::setClass( contains = "FAERS" ) +################ show method ######################## #' @param object A [FAERS] object. #' @importFrom methods show #' @export