tests/zooTests.R

library(nanotime)
suppressMessages(library(zoo))          

set.seed(42)
x <- 100 + cumsum(rnorm(10))
y <- 100 + cumsum(rnorm(10))
mat <- cbind(x, y)

now <- Sys.Date()
z <- zoo(mat, now + 0:9)
z

now <- Sys.time()
z <- zoo(mat, now + 0:9)
z

now <- nanotime(Sys.time())                  
z <- zoo(mat, now + 11*(0:9))           # inc. by 11 to more visible, 1 works too
z

Try the nanotime package in your browser

Any scripts or data that you put into this service are public.

nanotime documentation built on Oct. 24, 2022, 9:07 a.m.