Skip to content
Prev 213467 / 398500 Next

NAs and row/column calculations

Hi

r-help-bounces at r-project.org napsal dne 12.03.2010 00:20:39:
For
me.

You can consider matrix as a vector with dimensions. When you extract few 
values, dimensions are lost as they do not have a reasonable meaning in 
new object.

mat<-matrix(1:12, 3,4)
[,1] [,2] [,3] [,4]
[1,]    1    4    7   10
[2,]    2    5    8   11
[3,]    3    6    9   12
mat[-c(5,7)] 
 [1]  1  2  3  4  6  8  9 10 11 12
calcs
the
mention
The core of *apply function is that it applies any FUN function to an 
object in some particular way. How the FUN function behaves and what 
results you get is entirely on this FUN function. So whenever you get 
unexpected result with *apply family you shall first check help for used 
FUN function

Usage:

     sum(..., na.rm = FALSE)
 
Regards
Petr
http://www.R-project.org/posting-guide.html