partitions | R Documentation |
Distribute events into groups defined by time or numerical intervals. Each set of linked records are assigned a unique identifier with relevant group-level data.
partitions(
date,
window = NULL,
windows_total = 1,
separate = FALSE,
sn = NULL,
strata = NULL,
data_links = "ANY",
custom_sort = NULL,
group_stats = FALSE,
data_source = NULL,
by = NULL,
length.out = NULL,
fill = TRUE,
display = "none",
precision = 1
)
date |
|
window |
|
windows_total |
|
separate |
|
sn |
|
strata |
|
data_links |
|
custom_sort |
|
group_stats |
|
data_source |
|
by |
|
length.out |
|
fill |
|
display |
|
precision |
Round precision |
Each assigned group is referred to as a pane
A pane
consists of events within a specific time or numerical intervals (window
).
Each window
must cover a separate interval. Overlapping windows
are merged before events are distributed into panes.
Events that occur over two windows
are assigned to the last one listed.
Alternatively, you can create windows
by splitting a period into equal parts (length.out
), or into a sequence of intervals with fixed widths (by
).
By default, the earliest event is taken as the "Index"
event of the pane
.
An alternative can be chosen with custom_sort
.
Note that this is simply a convenience option because it has no bearing on how groups are assigned.
partitions()
will categorise records into 3 types;
"Index"
- Index event/record of the pane.
"Duplicate_I"
- Duplicate of the "Index"
record.
"Skipped"
- Records that are not assigned to a pane.
Every element in data_links
must be named "l"
(links) or "g"
(groups).
Unnamed elements of data_links
will be assumed to be "l"
.
If named "l"
, only groups with records from every listed data_source
will be retained.
If named "g"
, only groups with records from any listed data_source
will be retained.
NA
values in strata
excludes records from the partitioning process.
See vignette("episodes")
for more information.
pane
pane
; number_line_sequence
; episodes
; links
; overlaps
; number_line
; schema
events <- c(30, 2, 11, 10, 100)
windows <- number_line(c(1, 9, 25), c(3, 12, 35))
events
partitions(date = events, length.out = 3, separate = TRUE)
partitions(date = events, by = 10, separate = TRUE)
partitions(date = events, window = windows, separate = TRUE)
partitions(date = events, window = windows, separate = FALSE)
partitions(date = events, window = windows, separate = FALSE, windows_total = 4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.