Created
October 24, 2016 13:32
-
-
Save dgrtwo/75be17a819225b546eade7a4e2b7ccc6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # randomly select min_n_plates from each strain | |
| randomly_sampled_dataframe <- x %>% | |
| dplyr::group_by_(grouping_var, plate_var, sample_var) %>% | |
| tidyr::nest(.key = id_data) %>% | |
| dplyr::group_by_(grouping_var, plate_var) %>% | |
| dplyr::sample_n(min_n_id_per_plate) %>% | |
| tidyr::nest(.key = plate_data) %>% | |
| dplyr::group_by_(grouping_var) %>% | |
| dplyr::sample_n(min_n_plates_per_strain) %>% | |
| tidyr::unnest() %>% | |
| tidyr::unnest() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment