partition_time_bins: Time bin partitioner

Description Usage Arguments Details Value Author(s) Examples

View source: R/partition_time_bins.R

Description

Generates all possible contiguous partitions of N time bins.

Usage

1
partition_time_bins(n_time_bins, partition_sizes_to_include = "all")

Arguments

n_time_bins

The number of time bins.

partition_sizes_to_include

Either "all" (the default) or a vector of requested partition sizes.

Details

This function is designed for use with the test_rates function and generates all possible contiguous partitions of N time bins. This allows use of an information criterion like AIC to pick a "best" partition, weighing fit and partition number simultaneously.

You can also ask for only partitions of a specific number using the partition_sizes_to_include option. For example, partition_sizes_to_include = c(1, 2, 3) will only return partitions of 1, 2, or 3 sets of elements.

Value

Returns a list of lists of vectors ready for use in test_rates.

Author(s)

Graeme T. Lloyd graemetlloyd@gmail.com

Examples

1
2
3
4
5
# Get all partitions for four time bins:
partition_time_bins(n_time_bins = 4)

# Get all partitions for five time bins of size 2:
partition_time_bins(n_time_bins = 5, partition_sizes_to_include = 2)

Claddis documentation built on Oct. 23, 2020, 8:04 p.m.