Sub-split a split vector (Internal)
Details
This function is used to support contrasts_to_venn_setlists()
in order to limit the number of Venn sets included by subgroup.
This function adds another level of splitting, while keeping
the elements in the original order after splitting.
See also
Other jamses utilities:
choose_annotation_colnames(),
combine_sestats(),
contrast2comp_dev(),
fold_to_log2fold(),
intercalate(),
list2im_opt(),
list2im_value_internal(),
list_to_sestats(),
log2fold_to_fold(),
make_block_arrow_polygon(),
mark_stat_hits(),
matrix_normalize(),
merge_statdf_all_test(),
point_handedness(),
point_slope_intercept(),
shortest_unique_abbreviation(),
shrinkDataFrame(),
shrink_df(),
shrink_matrix(),
sort_samples(),
strsplitOrdered(),
update_function_params(),
update_list_elements()
Examples
icolsplit <- rep(c(1, 2, 3), c(6, 5, 4))
newsplit <- sub_split_vector(icolsplit)
split(icolsplit, newsplit)
#> $`1.1`
#> [1] 1 1 1 1
#>
#> $`1.2`
#> [1] 1 1
#>
#> $`2.1`
#> [1] 2 2 2
#>
#> $`2.2`
#> [1] 2 2
#>
#> $`3`
#> [1] 3 3 3 3
#>
newsplit3 <- sub_split_vector(icolsplit, max_size=3)
split(icolsplit, newsplit3)
#> $`1.1`
#> [1] 1 1 1
#>
#> $`1.2`
#> [1] 1 1 1
#>
#> $`2.1`
#> [1] 2 2 2
#>
#> $`2.2`
#> [1] 2 2
#>
#> $`3.1`
#> [1] 3 3
#>
#> $`3.2`
#> [1] 3 3
#>