Skip to content
Prev 75819 / 398502 Next

select previous date

You can try this:

dates <- df$date[df$temp==15]
one.month.before <- sapply(strsplit(dates, "-"), function(x)
paste(x[1], sprintf("%02d", as.numeric(x[2])-1), x[3], sep="-"))
df[df$date %in% one.month.before,]

Ben
On 8/18/05, alessandro carletti <alxmilton at yahoo.it> wrote: