emr_time2char: Convert time to character format

View source: R/time.R

emr_time2charR Documentation

Convert time to character format

Description

This function converts a given time value to a character format in the form of "

Usage

emr_time2char(time, show_hour = FALSE)

emr_char2time(char)

Arguments

time

The time value to be converted.

show_hour

Logical value indicating whether to include the hour in the output. Default is FALSE.

char

A character string to be converted to EMR time.

Value

A character string representing the converted time value.

Examples

# 30 January, 1938, 6:00 - birthday of Islam Karimov
t1 <- emr_date2time(30, 1, 1938, 6)
# September 2, 2016, 7:00 - death of Islam Karimov
t2 <- emr_date2time(2, 9, 2016, 7)

emr_time2char(c(t1, t2))
emr_time2char(c(t1, t2), show_hour = TRUE)

emr_char2time(emr_time2char(c(t1, t2), show_hour = TRUE))

# Note that when show_hour = FALSE, the hour is set to 0
# and therefore the results would be different from the original time values
emr_char2time(emr_time2char(c(t1, t2)))


naryn documentation built on Sept. 27, 2024, 5:07 p.m.