Displaying 1 result from an estimated 1 matches for "answerbad".
2011 Jul 27
2
apply is making me crazy...
...000*x),ncol=x))
## Two ways to see what was created:
for(k in 1:length(exampGood)) print(dim(exampGood[[k]]))
for(k in 1:length(exampBad)) print(dim(exampBad[[k]]))
## Take the cumsum of each row of each matrix
answerGood = lapply(exampGood, function(x) apply(x ,1,cumsum))
answerBad = lapply(exampBad, function(x) apply(x ,1,cumsum))
str(answerGood)
str(answerBad)
## Take the first element of the final column of each answer
for(mat in answerGood){
LastColumn = ncol(mat)
print(mat[1,LastColumn])
}
for(mat in answerBad){
LastColu...