Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R: Is there an equivalent to SAS's intck function?

Tags:

r

sas

I'm moving from SAS to R, and heavily use both INTCK and INTNX.

Are there any functions or packages that have similar functionality as these SAS functions?

Edit: Specifically I want to be able to compare two dates and return the amount of weeks in between them.

Thanks

like image 574
Michael Melillo Avatar asked Sep 27 '22 16:09

Michael Melillo


1 Answers

There is function difftime. Which is used as, considering dt1 and dt2 two values representing time :

difftime(dt1, dt2, units = "weeks")

and gives you the difference of dt1 to dt2 in weeks.

like image 175
Stelios K. Avatar answered Nov 09 '22 23:11

Stelios K.