Displaying 1 result from an estimated 1 matches for "tempmc".
Did you mean:
temp_c
2012 Jul 03
1
remove loop which compares row i to row i-1
...erences the last row.
In general I want to a remove a loop which looks something like this:
for 2 to number of rows in a matrix do{
if indextrow-1 is < currentIndexRow then do something.
}
My R code:
for (i in 2:length(tUnitsort$Hour)){
ifelse(tUnitsort[i,4]>=tUnitsort[i-1,4],(tempMC
=tUnitsort[i,7]),tempMC ) #col. 4 = BlockNumber; note tests to see if the
offers have change to the next set of blocks.
ifelse(tUnitsort[i,4]>=tUnitsort[i-1,4],(tempAC
=tUnitsort[i,7]-(tUnitsort[i,8]-tUnitsort[i,9])),tempAC )
tUnitsort$MC[i] <- tempMC
tUnitsort$AC[i] <-...