Skip to content

Commit

Permalink
mids fix
Browse files Browse the repository at this point in the history
  • Loading branch information
istallworthy committed Oct 9, 2023
1 parent fc8d3fa commit 8bf693c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions R/createWeights.R
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ createWeights <- function(home_dir, data, exposure, outcome, formulas, method =
stop ("Please provide either a 'mids' object, a data frame, or a list of imputed data frames in the 'data' field.",
call. = FALSE)
}
else if (is.list(data) && !is.data.frame(data)) {
else if (is.list(data) && !is.data.frame(data) && !mice::is.mids(data)) {
if (sum(sapply(data, is.data.frame)) != length(data)) {
stop ("Please supply a list of data frames that have been imputed.",
call. = FALSE)
call. = FALSE)
}
}

Expand Down
2 changes: 1 addition & 1 deletion R/fitModel.R
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ fitModel <- function(home_dir, data, weights, exposure, exposure_time_pts, outco
stop ("Please provide either a 'mids' object, a data frame, or a list of imputed data frames in the 'data' field.",
call. = FALSE)
}
else if (is.list(data) && !is.data.frame(data)) {
else if (is.list(data) && !is.data.frame(data) && !mice::is.mids(data)) {
if (sum(sapply(data, is.data.frame)) != length(data)) {
stop ("Please supply a list of data frames that have been imputed.",
call. = FALSE)
Expand Down

0 comments on commit 8bf693c

Please sign in to comment.