Re: [R] Deleting Rows based on Factor and Time Period

2011-09-14 Thread Mikkel Grum
alldat$yearmonth <- substr(alldat$mydate, 1, 7) From: Anna Dunietz Cc: "r-help@r-project.org" Sent: Wednesday, September 14, 2011 3:21 AM Subject: Re: [R] Deleting Rows based on Factor and Time Period Mikkel - thank you so much! That's a gr

Re: [R] Deleting Rows based on Factor and Time Period

2011-09-14 Thread Anna Dunietz
isoWeekYear(alldat$mydate)$ISOYear >> alldat$week <- isoWeekYear(alldat$mydate)$ISOWeek >> alldat <- alldat[order(alldat$year, alldat$week), ] >> alldat[!duplicated(paste(alldat$year, alldat$week, alldat$myeq)), ] >> >> >> >> - Original Message --

Re: [R] Deleting Rows based on Factor and Time Period

2011-09-14 Thread Anna Dunietz
> > - Original Message - > From: Anna Dunietz > To: r-help@r-project.org > Cc: > Sent: Tuesday, September 13, 2011 9:04 AM > Subject: [R] Deleting Rows based on Factor and Time Period > > Hi All! > > I have been messing around with this problem for about a we

Re: [R] Deleting Rows based on Factor and Time Period

2011-09-13 Thread Mikkel Grum
dat$week), ] alldat[!duplicated(paste(alldat$year, alldat$week, alldat$myeq)), ] - Original Message - From: Anna Dunietz To: r-help@r-project.org Cc: Sent: Tuesday, September 13, 2011 9:04 AM Subject: [R] Deleting Rows based on Factor and Time Period Hi All! I have been messing around with this

[R] Deleting Rows based on Factor and Time Period

2011-09-13 Thread Anna Dunietz
Hi All! I have been messing around with this problem for about a week but to no avail! The following data has been cut down in order to make my question reproducible. The alldat data frame includes 2 columns: 1 date column and 1 factor column (equity names)). mydate<-as.Date(c("2001-07-02","2001