Michael Melillo
Michael Melillo

Reputation: 167

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

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

Upvotes: 5

Views: 2174

Answers (1)

Stelios K.
Stelios K.

Reputation: 313

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.

Upvotes: 4

Related Questions