difftime function (possible Feature Request)

Discuss the jamovi platform, possible improvements, etc.
Post Reply
mherberg
Posts: 1
Joined: Wed Oct 14, 2020 2:25 pm

difftime function (possible Feature Request)

Post by mherberg »

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.
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: difftime function (possible Feature Request)

Post by jonathon »

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
eugenereed
Posts: 1
Joined: Wed Oct 21, 2020 11:53 am

Re: difftime function (possible Feature Request)

Post by eugenereed »

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.
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: difftime function (possible Feature Request)

Post by jonathon »

hi eugene,

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

cheers

jonathon
sbalci
Posts: 124
Joined: Sat Jan 06, 2018 10:25 pm
Contact:

Re: difftime function (possible Feature Request)

Post by sbalci »

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.
Post Reply