Displaying 2 results from an estimated 2 matches for "d2mat".
2020 Apr 04
5
Help useRs to use R's own Time/Date objects more efficiently
...stringsAsFactors = FALSE) {
DF <- as.data.frame(unclass(as.POSIXlt( dt )), stringsAsFactors=stringsAsFactors)
`names<-`(cbind(dt, DF, deparse.level=0L), c(dName, names(DF)))
}
dt2df(.leap.seconds) # date+time
dt2df(Sys.Date() + 0:9) # date
##' Even simpler: Date -> Matrix:
d2mat <- function(x) simplify2array(unclass(as.POSIXlt(x)))
d2mat(seq(as.Date("2000-02-02"), by=1, length.out=30)) # has R 1.0.0's release date
------------------------------------------------------------
In the distant past / one of the last times I touched on people
using (base) R...
2020 Apr 05
0
Help useRs to use R's own Time/Date objects more efficiently
...<- as.data.frame(unclass(as.POSIXlt( dt )), stringsAsFactors=stringsAsFactors)
> `names<-`(cbind(dt, DF, deparse.level=0L), c(dName, names(DF)))
> }
> dt2df(.leap.seconds) # date+time
> dt2df(Sys.Date() + 0:9) # date
>
> ##' Even simpler: Date -> Matrix:
> d2mat <- function(x) simplify2array(unclass(as.POSIXlt(x)))
> d2mat(seq(as.Date("2000-02-02"), by=1, length.out=30)) # has R 1.0.0's release date
>
> ------------------------------------------------------------
>
> In the distant past / one of the last times I touched on p...