Hi everyone,

I have a data frame, with the following format:

MatDate->
        row.names       ID1     ID2     ID3
1       date1
2       date1
3       date3
        etc

but I cannot perform a rollapply() statement on the matrix without
converting the matrix into a time series.
i.e. MatTs<-ts(MatDate)

Only then will my rollapply statement work:
MatMin<-rollapply(MatTs, 2,by=2, min, na.rm=F)

If I apply the rollapply() statement to the dataframe, I get the following
error: Error: could not find function "rollapply"

The problem is that when I convert the data.frame matrix into a time series
matrix, I lose the dates in the row.names column. I just want to know if
anyone could suggest a way to get around this problem, i.e. keep the
row.names column in place, and use the rollapply() statement as above.

Thanks,

rcoder
-- 
View this message in context: 
http://www.nabble.com/losing-row.names-in-matrix-operations-tp18788509p18788509.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to