Inside a function a need to convert some number, in general in range of 20 to 200, in to difftime
and show via format
as expected time needed to finish.
as.difftime
has got a useful units="auto"
so it will use "sec" say for 20 secs and "mins" for 60+ secs...
But it says also
> as.difftime(100, units="auto")
Error in as.difftime(100, units = "auto") :
need explicit units for numeric conversion
How can I avoid that?
EDIT: Current workaround
> (Sys.time()+100)-Sys.time()
Time difference of 1.666667 mins