Geoff,

I think you could write an if loop to solve this.

You could write:

for(i in 1:num_obs){

if(DAYS[i]=='Monday'){
DF$DAYS.BETWEEN[i]<-1
}
}

Where 'num_obs' is the total number of temperature observations you have. 
This would only be correct if you had no missing data on Fridays.  Also, if
you had any missing Mondays, the Tuesday 'DAYS.BETWEEN' would be a 5 instead
of a 2.

Maybe there's a better way to do this, but I think this should work as long
as you have a pretty complete record.

Billy

--
View this message in context: 
http://r.789695.n4.nabble.com/days-between-dates-tp3544335p3544643.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