#I wish to find the "next non-NA" value within each row of a data-frame.
#e.g. I have a data frame mydata. Rows 1, 2 & 3 have soem NA values.
mydata <- data.frame(matrix(seq(20*6), 20, 6))
mydata[1,3:5] <- NA
mydata[2,2:3] <- NA
mydata[2,5] <- NA
mydata[3,6] <- NA
mydata[1:3,]
#this loop acco
What is a "good" way to calculate the "moving product", for each row of a
dataframe, where I wish to be able to specify the length of the moving product?
Depending on my needs, I'd like to be able to specify the "length" over which
to calculate the moving average (in this example, length=3).
Fo
2 matches
Mail list logo