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

merge in selectCase.R #24

Open
yijutseng opened this issue Aug 22, 2019 · 1 comment
Open

merge in selectCase.R #24

yijutseng opened this issue Aug 22, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@yijutseng
Copy link
Contributor

https://github.com/DHLab-CGU/emr/blob/master/R/selectCases.R
裡面的第50行的merge是哪來做join還是rbind?
我看code的意思好像是rbind?
如果是的話,請不要用merge,改用rbindlist。
參考:https://stackoverflow.com/questions/15673550/why-is-rbindlist-better-than-rbind

其他function也檢查一下,merge只使用在真的有key並且左右表binding,程式碼會比較好懂。

@yijutseng yijutseng added the enhancement New feature or request label Aug 22, 2019
@amamagg
Copy link
Collaborator

amamagg commented Aug 28, 2019

commit 5eb8250
改好了, 另外之前討論的依照case number來平移計算是否時間範圍內有足夠的case數
還是有個問題, 只能找出"至少"符合使用者設定的case number
假設 case number = 3, time range = 30~365 days
patient A 有五筆資料, 每次計算相差天數以三筆計算
20120101
20120201
20120501
20120601
20150101
前三筆有符合 (count = 3)
但再往下加一筆還在時間範圍內 (count = 4)
無法真的算出時間範圍內真正的數量
但至少還是能符合使用者所設定"case"的條件

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

No branches or pull requests

2 participants