Re: [R] Extracting Elements By Date

2010-06-09 Thread Gabor Grothendieck
Try this and next time provide reproducible code and data as per posting guide (see last line of every message). First we create a sample data frame, DF. Then we use the zoo time series package to read it in and convert it from long form, DF, to wide form, z, with one column per id. Then we use

Re: [R] Extracting Elements By Date

2010-06-08 Thread Jeff08
edit: I found out how to declare empty variables in R, but the code still does not work. I get the index out of bounds error since my data is irregular (some have more dates than others, and the matrix will not allow for different sized rows) Dear R Gurus, Thanks for any help in advance! Date.f

[R] Extracting Elements By Date

2010-06-08 Thread Jeff08
Dear R Gurus, Thanks for any help in advance! Date.frame: Returns.names X id ticker date_ adjClose totret RankStk 258060 258060 13645T10 CP 2001-06-29 18.125 1877.758 My data frame is in the above format. I would like to filter by period, per id (every 125 days)