- 1. msg00052.html (score: 1)
- Author: Unknown
- Date: Fri May 05 04:58:22 2006
- you could try the following: n <- dim(x)[1] p <- dim(x)[2] x.bar <- as.matrix(colMeans(x)) m0 <- as.matrix(c(0,0)) S <- var(x) g <- (n/(n-1))*((n-p)/p)*t(x.bar-m0)%*%solve(S)%*%(x.bar-m0) p.value <-
- /archives/html/s-news/2002-08/msg00052.html (5,284 bytes)
- 2. msg00230.html (score: 1)
- Author: Unknown
- Date: Fri May 05 05:08:50 2006
- test <- apply(df,2,function(x){all(x<0)}) By the way, test is a bad name for any variable or function. SDB Kim, Try the "apply" functions: "apply","sapply","lapply","tapply" test <- apply(df,1,functi
- /archives/html/s-news/1999-09/msg00230.html (5,814 bytes)
- 3. msg00231.html (score: 1)
- Author: Unknown
- Date: Fri May 05 05:08:50 2006
- How about: my.fun<-function(data){all(data<0)} test<-apply(eg.df,2,my.fun) [,1] [,2] [,3] [,4] [1,] -1 1 -1 1 [2,] -1 1 -1 1 [3,] -1 1 -1 1 [4,] -1 1 -1 1 [1] T F T F -- Stephen J. Smith **
- /archives/html/s-news/1999-09/msg00231.html (5,820 bytes)
- 4. msg00232.html (score: 1)
- Author: Unknown
- Date: Fri May 05 05:08:50 2006
- I'm not sure what you want to do with it but here's an example: v<-c(1,2,3,-1,3,-2,4,0,-5,9,0,1,-2) v [1] 1 2 3 -1 3 -2 4 0 -5 9 0 1 -2 v<0 [1] F F F T F T F F T F F F T v[v<0] [1] -1 -2 -5 -2 v[v<0]
- /archives/html/s-news/1999-09/msg00232.html (5,562 bytes)
- 5. msg00233.html (score: 1)
- Author: Unknown
- Date: Fri May 05 05:08:50 2006
- which is to say, you want to check which columns have ALL negative values, right? you could do something like this: rep(1,nrow(df))%*%ifelse(df<0,1,0) == nrow(df) hope this helps. - peter **
- /archives/html/s-news/1999-09/msg00233.html (5,535 bytes)
- 6. msg00234.html (score: 1)
- Author: Unknown
- Date: Fri May 05 05:08:50 2006
- It's a good idea to avoid naming an S-PLUS data object 'df', since that will mask the built-in S-PLUS 'df()' function, which returns the density of the F distribution. Here is a trio of examples usin
- /archives/html/s-news/1999-09/msg00234.html (8,973 bytes)
- 7. msg00235.html (score: 1)
- Author: Unknown
- Date: Fri May 05 05:08:50 2006
- If your data is really a data frame (not a matrix) you can speed this up a bit with test <- unlist(lapply(df, function(dfi)all(dfi<0))) However, the major speedup in this case comes from lapply treat
- /archives/html/s-news/1999-09/msg00235.html (7,085 bytes)
- 8. msg00236.html (score: 1)
- Author: Unknown
- Date: Fri May 05 05:08:50 2006
- It is not exactly vectorization but you do this operation with the "apply" function which applies a function to subsections of an array. If I recall correctly it would look like apply( as.matrix(df),
- /archives/html/s-news/1999-09/msg00236.html (5,579 bytes)
- 9. msg00172.html (score: 1)
- Author: Unknown
- Date: Fri May 05 05:09:34 2006
- x <- matrix(rnorm(80), ncol=8, nrow=10) out <- cbind( c(x), c(row(x)), c(col(x))) out[order(out[,1]),] Is matrix(rank(a),nrow(a),ncol(a)) what you want? Example: [,1] [,2] [,3] [1,] 27 24 29 [2,] 21
- /archives/html/s-news/1999-07/msg00172.html (6,229 bytes)
- 10. msg00226.html (score: 1)
- Author: .edu>
- Date: Fri May 05 05:11:04 2006
- The "cov.mve" function approximates the matrix that represents the elllipse with the smallest area that covers 'quan' fraction of the data. 'quan' isn't an argument to 'cov.mve' but you can modify it
- /archives/html/s-news/1999-03/msg00226.html (5,770 bytes)
- 11. msg00227.html (score: 1)
- Author: known
- Date: Fri May 05 05:11:04 2006
- An interesting problem. Here is one ad hoc approach that requires a bit of exploration first but then is semiautomated. The problem as you state it may not have a unique solution. This is related to
- /archives/html/s-news/1999-03/msg00227.html (7,917 bytes)
- 12. Re: [S] Brush & Spin on Sun Ultrasparc 1 (score: 1)
- Author: Unknown
- Date: Fri May 05 05:15:10 2006
- Dear Mr. Gansen, I checked our database, and Doug Johnson sent you the following message on February 17, 1998 regarding your problem: Dear Carl Gansen, Thank you for your question: This is a known bu
- /archives/html/s-news/1998-03/msg00077.html (11,320 bytes)
This search system is powered by
Namazu