On Jul 5, 2012, at 6:52 PM, jcrosbie wrote:
Thank you, I tired ifelse(tUnitsort[length(tUnitsort$Hour),4]>=tUnitsort[-1,4],(tempMC =tUnitsort[length(tUnitsort$Hour),7]),tempMC )
Presumably tempMC is a vector of the appropriate length, in which case this should repalce that loop:
tempMC [ diff(tUnitsort) > 0 ] <- tUnitsort[ , 7][ diff(tUnitsort) > 0 ]
But this doesn't seem to work.
Doesn't work .... means what?
Where am I going wrong?
How can we tell without a worked example????
-- View this message in context: http://r.789695.n4.nabble.com/remove-loop-which-compares-row-i-to-row-i-1-tp4635327p4635566.html Sent from the R help mailing list archive at Nabble.com.
Dear tired Nabble user. Please read the Posting Guide.
>>>>>>>>>>>>>>>>>>>>>>>>
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>>>>>>>AND>>>>>>>>
.....provide commented, minimal, self-contained, reproducible code.
-- David Winsemius, MD West Hartford, CT ______________________________________________ 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.