ropensci / coder

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

Warning if id not unique #46

Closed eribul closed 5 years ago

eribul commented 5 years ago

If categorize/classify is called and if specified id column is not a unique id, stop! id column must give unique ids. If not, the operation must be split! Use data.tableuniqueN to determine if id unique or not.

eribul commented 5 years ago

Possible solution to use when using the package:

cases %>%
  group_by(P_Side) %>% 
  do(
    categorize(
      .,
      par_icd_utdatum,
      "elix_icd10",
      id         = "LopNr",
      date       = "P_SurgDate",
      days       = c(-365, -1),
      tech_names = TRUE
   )
  )
eribul commented 5 years ago

Have updated but not tested the package. Test before closeing the issue.