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

Allow nesting based on other variables #68

Open
emitanaka opened this issue Nov 26, 2023 · 2 comments
Open

Allow nesting based on other variables #68

emitanaka opened this issue Nov 26, 2023 · 2 comments

Comments

@emitanaka
Copy link
Owner

Something like:

design() %>% 
  set_units(group = 2,
                   subject = nested_in(group, 5),
                   cells = nested_in(subject, .based_on = group,
                                                           1 ~ 2,
                                                           2 ~ 4))
@gavin-kelly-1
Copy link

gavin-kelly-1 commented Nov 26, 2023

Looks really useful - perhaps an even more general nested_in(subject, ~ifelse(group=="group1",2,4)) where formulae without a lhs would be evaluated to provide the nested levels.

@emitanaka
Copy link
Owner Author

I agree with keeping it general like you say. Let me think about how this affects the underlying graph structure (and subsequently the suggested design_model()). Part of the problem is that you can end up specifying a crossed structure but it won't be encoded as such in the system and hence causes issues downstream. So in that sense, we might need some constrain so it doesn't allow users to go too wild.

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