check_tz: Check the time zone of an object and force UTC if absent

View source: R/utils.R

check_tzR Documentation

Check the time zone of an object and force UTC if absent

Description

This function checks the time zone of an inputted object. If the object is of class Date or POSIXct and a time zone is absent, then "UTC" is forced. Otherwise, the object is returned unchanged.

Usage

check_tz(arg = deparse(substitute(input)), input)

Arguments

arg

(optional) A character string which defines the argument of the parent function.

input

An object.

Value

An object as inputted in which, if the object is of class Date or POSIXct and a time zone is absent, time zone "UTC" is forced.

Author(s)

Edward Lavender

Source

This function is taken from the ‘utils.add’ package (https://github.com/edwardlavender/utils.add). It is defined separately in flapper to reduce reliance on non-default packages.


edwardlavender/flapper documentation built on Jan. 22, 2025, 2:44 p.m.