Skip to content

Commit 2dd498f

Browse files
authored
Added check
Ensures `weights` is either NULL or a string.
1 parent 9feba45 commit 2dd498f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

R/event_study.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ event_study = function(data, yname, idname, gname, tname,
6868
message(paste0("Warning: `", xformla, "` is ignored for the `staggered` estimator"))
6969
}
7070
}
71+
72+
# Checking weights
73+
if (!(is.null(weights) || is.character(weights))) {
74+
stop("Argument `weights` must be `NULL` or a character string")
75+
}
7176

7277
# Setup ------------------------------------------------------------------------
7378

0 commit comments

Comments
 (0)