ropensci / coder

Classification of Cases into Deterministic Categories
https://docs.ropensci.org/coder/
22 stars 4 forks source link

categorize take codify output as input #112

Closed eribul closed 4 years ago

eribul commented 4 years ago

I expected categorize to be able to take the results of a call to codify as input. This could be a useful alternative specification option, and is being done internally anyhow

eribul commented 4 years ago

I think it should be possible. if we just take data.table::unique(data, ...) excluding the code, code_date and in_period columns as substitute for data.

Thus:

  1. codified data gets class codified
  2. categorize become generic S3.
  3. Methods for data.frame, data.table, codified and classified
eribul commented 4 years ago

Fixed in: 9c52b7f

eribul commented 4 years ago

Review: This is a good point, wherefore categorize has now been made S3-generic with a dedicated method for objects of class codified (a new class used for the output from codify())