Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/xpssComputeDates.R
R Implementation of the SPSS CTIME.DAYS Function. computeCtime_days is a helper function for xpssCompute.
1 |
x |
atomic object of class |
date |
atomic object of class |
The input format of the date's is "YYYY-MM-DD" as Date, and with timeparameters YYYY-MM-DD HH:MM:SS.
Examples:
| Date w/o Time | Date with Time | |
| YYYY-MM-DD | YYYY-MM-DD HH:MM:SS | |
| 2015-01-01 | 2015-01-01 00:00:00 | |
| 2015-12-31 | 2015-12-31 23:59:59 |
It is possible to calculate the difference between the dates, even if they do not have the same structure. It is possible to match dates without time paramters, with dates which contain the time parameters. Additionally it is possible to match dates which are not in the right format.
Note: The calculation of two dates, one with the format YYYY-MM-DD and the other one with the format DD-MM-YYYY is valid, but not recommended.
computeCtime_days returns the difference between x and date in days.
Bastian Wiessner
difftime DateTimeClasses as.POSIXlt strptime
1 2 | xpssCompute(x="2013-09-14", fun="computeCtime_days", date="2013-09-11")
xpssCompute(x="2015-11-28", fun="computeCtime_days", date="2014-11-28")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.