ddateDistance | R Documentation |
Calculate the distance (i.e. dissimilarity) between two deposition dates
ddateDistance( ddate1, ddate2, normalizeBy = 5, clipWindow = FALSE, na.dist = 0.5 )
ddate1 |
1D array of POSIX dates |
ddate2 |
same format and length as ddate1 |
normalizeBy |
Numeric scalar to be used for normalization, i.e. the number of days, that defines the distance value of 1 |
clipWindow |
Should differences larger than 'normalizeBy' number of days be set to distance 'Infinity'? default FALSE. |
na.dist |
replace NA values with that distance |
An array of length(ddate1) containing the distances according to the configurations.
fherla
## create ddate arrays.. ddate <- as.POSIXct("2019/04/20 12:00", tz = "UTC") ddate1 <- rep(ddate, 5) ddate2 <- as.POSIXct(c("2019/04/12 08:00", "2019/04/16 10:00", "2019/04/20 12:00", "2019/04/21 16:00", "2019/04/22 20:00"), tz = "UTC") ## .. and calculate distance: ddateDistance(ddate1, ddate2, normalizeBy = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.