Quantcast
Channel: Active questions tagged xts - Stack Overflow
Viewing all articles
Browse latest Browse all 57

Take every Xth value of an xts object

$
0
0

I've got an xts object that contains data in a temporal resolution of seconds. For instance:

times <- seq.POSIXt(from=as.POSIXct("2023-04-01 00:00:00"), to=as.POSIXct("2023-04-04 00:01:00"), by = "sec")xdata <- runif(n=length(times))series <- xts(xdata, order.by=times)

What I want is a time series that uses every Xth element. For instance use only every 10th second. How do I accomplish this?


Viewing all articles
Browse latest Browse all 57

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>