Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

set_graph_time

Set graph date-time and timezone


Description

Set the time and timezone for a graph object of class dgr_graph.

Usage

set_graph_time(graph, time = NULL, tz = NULL)

Arguments

graph

A graph object of class dgr_graph.

time

The date-time to set for the graph.

tz

The timezone to set for the graph.

Value

A graph object of class dgr_graph.

Examples

# Create an empty graph
graph <- create_graph()

# Provide the new graph with a timestamp (if `tz`
# is not supplied, `GMT` is used as the time zone)
graph_1 <-
  graph %>%
  set_graph_time(time = "2015-10-25 15:23:00")

# Provide the new graph with a timestamp that is
# the current time; the time zone is inferred from
# the user's locale
graph_2 <-
  graph %>%
  set_graph_time()

# The time zone can be updated when a timestamp
# is present
graph_2 <-
  graph_2 %>%
  set_graph_time(tz = "America/Los_Angeles")

DiagrammeR

Graph/Network Visualization

v1.0.6.1
MIT + file LICENSE
Authors
Richard Iannone [aut, cre] (<https://orcid.org/0000-0003-3925-190X>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.