Description Usage Arguments Value Examples
View source: R/subset_series.R
Subsetting a graph series by the graphs' index positions in the graph series or through selection via graphs' datetime attributes.
1  subset_series(graph_series, by = "number", values, tz = NULL)

graph_series 
a graph series object of type

by 
either 
values 
where the subsetting of the graph
series by to occur via graph indices (where

tz 
the time zone ( 
a graph series object of type
dgr_graph_1D
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59  # Create three graphs
graph_time_1 <
create_graph(
graph_name = "graph_with_time_1") %>%
set_graph_time(
time = "20150325 03:00",
tz = "GMT")
graph_time_2 <
create_graph(
graph_name = "graph_with_time_2") %>%
set_graph_time(
time = "20150326 03:00",
tz = "GMT")
graph_time_3 <
create_graph(
graph_name = "graph_with_time_3") %>%
set_graph_time(
time = "20150327 15:00",
tz = "GMT")
# Create an empty graph series and add
# the graphs
series_temporal <
create_series(series_type = "temporal") %>%
add_to_series(
graph = graph_time_1,
graph_series = .) %>%
add_to_series(
graph = graph_time_2,
graph_series = .) %>%
add_to_series(
graph = graph_time_3,
graph_series = .)
# Subset graph series by sequence
series_sequence_subset <
subset_series(
graph_series = series_temporal,
by = "number",
values = 2)
# Get a count of graphs in the series
graph_count(series_sequence_subset)
#> [1] 1
# Subset graph series by datetime
series_time_subset <
subset_series(
graph_series = series_temporal,
by = "time",
values = c("20150325 12:00",
"20150326 12:00"),
tz = "GMT")
# Get a count of graphs in the series
graph_count(series_time_subset)
#> [1] 2

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.