David Winsemius
On Jan 8, 2009, at 5:52 AM, Christian Kamenik wrote:
> Dear all,
>
> 'Apply' is a great thing for running functions on rows or columns of
> a matrix:
>
> X <- rnorm(20, mean = 0, sd = 1)
> dim(X) <- c(5,4)
> apply(X,2,sum)
>
> Is there a way to use apply for excluding rows or columns from a
> matrix to run functions on the remaining rows or columns? I know, I
> could do this with a 'for' loop, but 'apply' would be much easier
> and quicker, and require less programming...
>
> Cheers, Christian
>
> ______________________________________________
> R-help at 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.