I am attempting to convert a second in numeric value into time format when printing out in HTML outlook mail. My data frame displays 79 as 00:01:19 however when I use xtable() and print() the result spits out 79 instead of 00:01:19. I am using xtable() and RDCOMClien() and hms() packages.
A reproducible example is:
seconds <- c(92,100,45)
queue_secs <- as.hms(round(mean(queue_secs)))
x <- data.frame(queue_secs)
time_in_secs <- print(xtable(x), type="html", print.results=FALSE, )
time_in_secs_body <- paste0("<html>", time_in_secs,"<html>")```
Does anyone know what the magic is to have the time format as the output in HTML or any alternative suggestions?
Every R problem can be thought of with advantage as the interaction of three objects— an existing object, x , a desired object,y , and a function, f, that will return a value of y given x as an argument. In other words, school algebra— f(x) = y. Any of the objects can be composites.
In the problem x is typeof integer and y is typeof character. The most direct route from x \rightarrow y is directly through typeof character, rather than taking a detour to typeof datetime