Learn R Programming

aNCA (version 0.1.0)

convert_to_iso8601_duration: Convert Numeric Value and Unit to ISO 8601 Duration

Description

The function converts a numeric value and its associated time unit into ISO 8601 duration string.

Usage

convert_to_iso8601_duration(value, unit)

Value

A character string representing the duration in ISO 8601 format.

Arguments

value

A numeric value representing the time/duration.

unit

A character string representing the unit of the time/duration.

Details

It is a sensitive function that assumes that a valid time unit is given by the user. That means that if other units starting with 'y', 'm', 'w', 'd', 'h', or 's' are provided, it will make a naive guess that it refers to a time unit as year, month, week, day, hour, sec...