medflex doesn't play well with tbl_df data.frames from the popular dplyr package. The pull request fixes that at least in one location. There might be problems at other places too but at least this error disappears. Probably all syntax like data[, ONEVARIABLE] doesn't work. data[[VARIABLE]] solves the problem
# the example from the paper works fine
impFit <- glm(UPB ~ factor(attbin) + negaff + gender + educ + age, family = binomial("logit"), data = UPBdata)
expData <- neImpute(impFit)
# when the dataset is first converted with tbl_df, neImpute doesn't work
impFit <- glm(UPB ~ factor(attbin) + negaff + gender + educ + age, family = binomial("logit"), data = tbl_df(UPBdata))
expData <- neImpute(impFit)
… dplyr package
medflex doesn't play well with
tbl_df
data.frames from the populardplyr
package. The pull request fixes that at least in one location. There might be problems at other places too but at least this error disappears. Probably all syntax likedata[, ONEVARIABLE]
doesn't work.data[[VARIABLE]]
solves the problem