Displaying 1 result from an estimated 1 matches for "exampbad".
2011 Jul 27
2
apply is making me crazy...
...n.
I wish it had a "drop=TRUE/FALSE" option like the "[" (and I wish I had
found the drop option a year ago, and I wish that I had 1e6 dollars... Oops,
I mean euros).
## Make three example matricies
exampGood = lapply(2:4, function(x)matrix(rnorm(1000*x),ncol=x))
exampBad = lapply(1:3, function(x)matrix(rnorm(1000*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(exampG...