-
Notifications
You must be signed in to change notification settings - Fork 16
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Complex Filtering #73
Comments
@mattkumar thanks for submitting this! Currently this wouldn't be possible because we don't really have a clean way to make groups pass down into where filter conditions are applied. We didn't really plan for that so it would take a good bit of thought for how to do it elegantly. Like I'm almost thinking that it would be safer to pre-derive a flag and use the flag, which is how ADaM datasets would typically set things up. Because grouping and ungrouping here is a bit tricky. What do you think? |
Hi guys,
I'm attempting to use Tplyr to compute a group_count layer that I'm not sure how to specify. To give some background, I've simulated a partial adae table below that has USUBJID, ARM and AETOXGRN. AETOXGRN is a toxicity grading used frequently within Oncology and ranges from 1 to 5.
What I'm interested in counting is each subjects worst (i.e. highest) toxicity grades. I'm interested in distinct counts, so for example, if subject X had two AEs, one graded with AETOXGRN = 1, and another with AETOXGRN = 4, I'd like this subject to be counted in the "4" category only.
I can achieve this in dplyr, and also achieve this in Tplyr with some up-front filtering. However, I'm wondering if I can specify something like this directly in Tplyr.
Here is some code for my exploration.
I can see that Tplyr only outputs the result for the max(AETOXGRN) grade, 5, which looks correct. So it seems my filter is acting on a data set level rather than a per USUBJID level. Is there a good way to specify a
where
filter of this nature or have I maybe missed other options in Tplyr?Curious to hear any thoughts!
Thanks!
Matt
The text was updated successfully, but these errors were encountered: