You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was getting some errors with lmtp_{sdr, tmle, sub} when the input data is a tbl_df/tbl:
Error in `[[<-`(`*tmp*`, trt_var, value = NULL) :
Can't assign column with `trt_var`.
✖ Subscript `trt_var` must be a location, not a character `NA`.
This is because tbl_df/tbls are more type-safe that data.frames, so they have additional type handling.
See a possible fix in #136. Other approaches might include ensuring Task returns data.frames to avoid the error further up the stacktrace, or simply assert that the input data must be a data.frame.
Expected behaviour is the absence of an error. Error is illustrated below.
rdf<-data.frame()
rdf[[as.character(NA)]] <-NULL# This is fine; it will do nothingtdf<- tibble()
tdf[[as.character(NA)]] <-NULL# This will error as lmtp does
Issue description
I was getting some errors with
lmtp_{sdr, tmle, sub}
when the input data is atbl_df
/tbl
:This is because
tbl_df
/tbl
s are more type-safe thatdata.frame
s, so they have additional type handling.See a possible fix in #136. Other approaches might include ensuring
Task
returnsdata.frame
s to avoid the error further up the stacktrace, or simply assert that the input data must be adata.frame
.reprex
Expected behavior
Expected behaviour is the absence of an error. Error is illustrated below.
R session info
The text was updated successfully, but these errors were encountered: