span_around | R Documentation |

Span a vector of specified interval around a variable of class `Date`

,
`POSIXct`

, or `POSIXlt`

..

span_around(x, interval, start_shift = NULL, end_shift = start_shift)

`x` |
A vector of class |

`interval` |
Character, specifying the desired interval. |

`start_shift` |
Character, indicating the time to shift back from the first observation. |

`end_shift` |
Character, indicating the time to shift forward from the last observation. |

Note that use of the `start_shift`

and `end_shift`

arguments change the entire spanning when they are not in line with
the interval. It is not checked for.

A datetime vector, with the first observation smaller or equal than
`min(x)`

and the last observation larger or equal than `max(x)`

.
Spaces between points are equal to `interval`

.

span_around(coffee$time_stamp, "hour") span_around(coffee$time_stamp, "hour", end_shift = "2 hour") span_around(coffee$time_stamp, "2 day") span_around(coffee$time_stamp, "2 day", start_shift = "2 day") span_around(emergency$time_stamp, "week") span_around(emergency$time_stamp, "2 month")

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.