Skip to content

data.table method #12

Description

@medewitt

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions