Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

obic_field_dt suggests it works for multipile fields but doesn't #155

Open
BrentWHR opened this issue Dec 6, 2021 · 1 comment
Open

Comments

@BrentWHR
Copy link
Contributor

BrentWHR commented Dec 6, 2021

The description of input parameter dt reads: dt (data.table) A data.table containing the data of the fields to calculate the OBI
However, when obic_field() is called, the ID parameter = 1.
Any ID passed to obic_field_dt() is not preserved.

To implement this functionality checks on ID may be needed in obic_field_dt()
additionally, a unit test for a dt with multipile fields (and ID's) is required

Alternatively, explicitly do not support multiplie fields and have users loop over their fields or something similair.

@JobdePater
Copy link
Contributor

as a temp solution looping on user side can be done by

dt.obi <- lapply(unique(dt$ID), function(i) obic_field_dt(dt[ID==i])[,ID:=i]) |> rbindlist()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants