-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
Description
I've run into an issue where I have to convert data.table objects to data.frames in order for the rules to be applied.
library(data.table)
library(magrittr)
library(dcmodify)
dt_women <- as.data.table(women)
m <- modifier( if (height < mean(height)) height <- 2*height
, if ( weight > mean(weight) ) weight <- weight/2 )
dt_out <- modify(dt_women,m)
df_out <- modify(women,m)
sum(delta_out <- dt_out$weight - df_out$weight)
Output:
527
It looks like the methods aren't picking up the second class of the data.table objects