R version 4.5.0 beta (2025-04-01 r88091 ucrt) -- "How About a Twenty-Six" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit 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 x y 2025-04-02 101.3710 101.30487 2025-04-03 100.8063 103.59152 2025-04-04 101.1694 102.20265 2025-04-05 101.8023 101.92387 2025-04-06 102.2065 101.79054 2025-04-07 102.1004 102.42649 2025-04-08 103.6119 102.14224 2025-04-09 103.5173 99.48579 2025-04-10 105.5357 97.04532 2025-04-11 105.4730 98.36543 > > now <- Sys.time() > z <- zoo(mat, now + 0:9) > z x y 2025-04-02 14:32:22 101.3710 101.30487 2025-04-02 14:32:23 100.8063 103.59152 2025-04-02 14:32:24 101.1694 102.20265 2025-04-02 14:32:25 101.8023 101.92387 2025-04-02 14:32:26 102.2065 101.79054 2025-04-02 14:32:27 102.1004 102.42649 2025-04-02 14:32:28 103.6119 102.14224 2025-04-02 14:32:29 103.5173 99.48579 2025-04-02 14:32:30 105.5357 97.04532 2025-04-02 14:32:31 105.4730 98.36543 > > now <- nanotime(Sys.time()) > z <- zoo(mat, now + 11*(0:9)) # inc. by 11 to more visible, 1 works too > z x y 2025-04-02T12:32:22.112761974+00:00 101.3710 101.30487 2025-04-02T12:32:22.112761985+00:00 100.8063 103.59152 2025-04-02T12:32:22.112761996+00:00 101.1694 102.20265 2025-04-02T12:32:22.112762007+00:00 101.8023 101.92387 2025-04-02T12:32:22.112762018+00:00 102.2065 101.79054 2025-04-02T12:32:22.112762029+00:00 102.1004 102.42649 2025-04-02T12:32:22.112762040+00:00 103.6119 102.14224 2025-04-02T12:32:22.112762051+00:00 103.5173 99.48579 2025-04-02T12:32:22.112762062+00:00 105.5357 97.04532 2025-04-02T12:32:22.112762073+00:00 105.4730 98.36543 > > > proc.time() user system elapsed 0.92 0.18 1.04