I have a zoo time series with missing days. In order to fill it and have a continuous series I do...
我从一开始即产生时间序列。
我的系列内容与这一系列内容合并。
我用na.locf用激光肥料替代北美人。
我删除了牙齿序列。
Can I do same easier? Maybe with some index function related to the frequency?
I have a zoo time series with missing days. In order to fill it and have a continuous series I do...
我从一开始即产生时间序列。
我的系列内容与这一系列内容合并。
我用na.locf用激光肥料替代北美人。
我删除了牙齿序列。
Can I do same easier? Maybe with some index function related to the frequency?
如果你使用“豁免”<代码>zoo,则稍为容易。 标有指数的物体。
> x <- zoo(1:10,Sys.Date()-10:1)[c(1,3,5,7,10)]
> empty <- zoo(order.by=seq.Date(head(index(x),1),tail(index(x),1),by="days"))
> na.locf(merge(x,empty))
2010-08-14 2010-08-15 2010-08-16 2010-08-17 2010-08-18
1 1 3 3 5
2010-08-19 2010-08-20 2010-08-21 2010-08-22 2010-08-23
5 7 7 7 10
EDIT:
For intra-day data (using Gabor s excellent xout=
suggestion):
> index(x) <- as.POSIXct(index(x))
> na.locf(x, xout=seq(head(index(x),1),tail(index(x),1),by="15 min"))
http://cran.r-project.org/web/ Packages/zoo/vignettes/zoo-faq.pdf rel=“noreferer” http://cran.r-project.org/web/ Packages/zoo/vignettes/zoo-faq.pdf。 采用Xout=na.locf论点来消除合并步骤。 相信你正在使用1.6.4代乐器,或是在最近添加这一特征之后使用。
This is a really really simple question to which I seem to be entirely unable to get a solution. I would like to do a scatter plot of an observed time series in R, and over this I want to plot the ...
since the latest Ubuntu release (karmic koala), I noticed that the internal R package advertises on start-up the REvolution package. It seems to be a library collection for high-performance matrix ...
I am trying to run an analysis by invoking R through the command line as follows: R --no-save < SampleProgram.R > SampleProgram.opt For example, consider the simple R program below: mydata =...
I m trying to generate GOFrame objects to generate a gene ontology mapping in R for unsupported organisms (see http://www.bioconductor.org/packages/release/bioc/vignettes/GOstats/inst/doc/...
I have a dataframe df.all and I m plotting it in a bar plot with ggplot2 using the code below. I d like to make it so that the order of the dodged bars is flipped. That is, so that the bars labeled "...
I m getting a weird error when training a glmnet regression. invalid class "dgCMatrix" object: length(Dimnames[[2]]) must match Dim[2] It only happens occasionally, and perhaps only under larger ...
Sorry for the non-descriptive title but I don t know whether there s a word for what I m trying to achieve. Let s assume that I have a list of names of different classes like c( 1 , 2 , 3 , 4 ) ...
I m plotting a group of curves, using facet in ggplot2. I d like to have a smoother applied to plots where there are enough points to smooth, but not on plots with very few points. In particular I d ...