Zoo
Replacing NAs with latest non-NA value
In a data.frame (or data.table), I would like to "fill forward" NAs with the closest previous non-NA value. A simple example, using vectors (instead of a data.frame) 开发者_开发百科is the fo[详细]
2023-04-12 04:44 分类:问答Rollapply & xts. Can I output the time of max value in the window?
I\'m studying some yahoo finance data via quantmod. How would I determine not only the Max and Min price over a rolling window of data, but also the exact Timestamp of those highs and lows? I have tr[详细]
2023-04-10 08:35 分类:问答Question regarding llply or lapply - applying functions to data.frames in a list
Dear R user community, I have many data.frames in a list, as follows (only one data.frame in the list of 21 shown for convenience):[详细]
2023-04-08 19:46 分类:问答Aggregate (count) occurences of values over arbitrary timeframe
I have a CSV file with timestamps and certain event-types which happened at this time. What I want is count the number of occurences of certain event-types in 6-minutes intervals.[详细]
2023-04-08 11:14 分类:问答na.locf but don't do trailing NAs
I have the following time series > y<- xts(1:10, Sys.Date()+1:10) > y[c(1,2,5,9,10)] <- NA > y[详细]
2023-04-02 10:53 分类:问答Adding points to xts plot
I开发者_如何学运维 thought Adding Points, Legends and Text to plots using xts objects would have the answer to this question, but apparently not...[详细]
2023-04-02 04:43 分类:问答How to use `apply.monthly` in a zoo object with several columns
I have a zoo object called pp with daily data and 77 columns that looks like this: X02R X03N X04K X04N X04R X06I X06N X08J X08P X09O X11O X12L X14N X15G X16K(...)[详细]
2023-04-01 20:49 分类:问答Using the file name to name a column
I have hundreds of csv files (zoo objects in R) with 2 columns: \"Index\",\"pp\" 1951-01-01,22.9 1951-01-02,4.3[详细]
2023-04-01 02:13 分类:问答R: merge two irregular time series
I have two multivariate time series x and y, both covering approximately the same range in time (one starts two years before the other, but they end on the same date). Both series have missing observa[详细]
2023-03-29 03:24 分类:问答Average two Zoo vectors with same index?
Suppose I have two \'zoo\' vectors, of equal length, with the same indices for both. Is there a simple function that allows me to take the average开发者_如何学编程 of both, by date (index)?[详细]
2023-03-18 18:06 分类:问答