How about:
my.fun<-function(data){all(data<0)}
test<-apply(eg.df,2,my.fun)
#careful df is an splus function
>eg.df<-matrix(c(-1,1,-1,1),4,4,byrow=T)
> eg.df
[,1] [,2] [,3] [,4]
[1,] -1 1 -1 1
[2,] -1 1 -1 1
[3,] -1 1 -1 1
[4,] -1 1 -1 1
> my.fun<-function(data){all(data<0)}
> test<-apply(eg.df,2,my.fun)
> test
[1] T F T F
-------------------------------------------------------------
Stephen J. Smith
************************************************************
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [no subject], Unknown |
|---|---|
| Next by Date: | [no subject], Unknown |
| Previous by Thread: | [no subject], Unknown |
| Next by Thread: | [no subject], Unknown |
| Indexes: | [Date] [Thread] [Top] [All Lists] |