1 | make.btrack.alldates(track, psat)
|
track |
|
psat |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (track, psat)
{
require(date)
alldates = seq(psat$day0, psat$dayT)
alldates.dmy = date.mdy(alldates)
alldates.dmy = cbind(alldates.dmy[[2]], alldates.dmy[[1]],
alldates.dmy[[3]])
bdates = mdy.date(track[, 2], track[, 3], track[, 1])
bidx = match(bdates, alldates)
output = as.data.frame(matrix(NA, nrow = length(alldates),
ncol = ncol(track)))
names(output) = names(track)
output[, 1:3] = alldates.dmy
output[bidx, 4:ncol(track)] = track[, 4:ncol(track)]
output
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.