difftime function (possible Feature Request)

Discuss the jamovi platform, possible improvements, etc.

by mherberg » Wed Oct 14, 2020 2:40 pm

I apologize if this has been asked before, but I could not find it in search.

Is there support for base time functions or R dates (DateTimeClasses)? It appears not but I wanted to check. For example is there any easy way to calculate the interval between two columns like difftime function performs.

Thank you.
mherberg
 
Posts: 1
Joined: Wed Oct 14, 2020 2:25 pm

by jonathon » Thu Oct 15, 2020 5:17 am

we don't have a date/time data type unfortunately.

a workaround is to express dates with an integer expressing the number of days since a particular date. then you can just subtract them.

jonathon
User avatar
jonathon
 
Posts: 1479
Joined: Fri Jan 27, 2017 10:04 am

by eugenereed » Wed Oct 21, 2020 11:58 am

Hi,

Is it possible to add a feature like difftime function in the future? As jonathon stated, a solution can be achieved in a way, but I believe that adding this feature will be a great convenience.
Best regards.

Eugene Reed
eugenereed
 
Posts: 1
Joined: Wed Oct 21, 2020 11:53 am

by jonathon » Thu Oct 22, 2020 2:07 am

hi eugene,

it's definitely on the todo list. however adding a new data type is not a small task.

cheers

jonathon
User avatar
jonathon
 
Posts: 1479
Joined: Fri Jan 27, 2017 10:04 am

by sbalci » Thu Oct 22, 2020 7:53 am

I tried to add time difference using lubridate::interval() into jsurvival module.
It is very strict. Does not accept if format is not specified correctly.
Why do you want to calculate time interval? I would like to learn use case, and add if it is related to jsurvival module.
sbalci
 
Posts: 47
Joined: Sat Jan 06, 2018 10:25 pm


Return to General