Re: [R] for loop help

2007-03-26 Thread Anthony Steven Dick
Thanks Adai. You can tell by the clumsiness of my script that I am new to R and to programming. After wrestling with it this morning, I found that the following worked best: pre.outliers<-subset(final.roi.df, gFDR4FWHM >= 1.96) detach(final.roi.df) attach(pre.outlie

Re: [R] for loop help

2007-03-25 Thread Adaikalavan Ramasamy
Try changing outliers <- subset(pre.outliers, gtvalue4FWHM >= 0.00) to w <- which( gtvalue4FWHM >= 0.00 ) outliers( length(w) > 0, pre.outliers[ w, ], NA ) Other comments: 1. Make sure you detach(data_gcs) at the end of the loops 2. scale() works on columns by default, so try

[R] for loop help

2007-03-25 Thread Anthony Steven Dick
Hello- I have a script which steps through a series of subjects, and for the subjects I remove outlying values. After removing these outliers, I specify a cutoff, keeping only values over a certain value (e.g., 1.96). I want to populate a matrix with a statistic of the values that make the cut

Re: [R] For loop help

2004-02-22 Thread Tom Blackwell
Xian - I interpret this as a question about subscripting. Read help("Subscript"), help("Control"). Perhaps the roughly 40 page pdf document "An Introduction to R" (or something like that) found under "Manuals" on the R home page would be helpful in getting started. I don't understand enough of

[R] For loop help

2004-02-22 Thread li xian
hello, I would like to do a for loop for matrix: Xm Xm-1 .. X1 Xm+1 Xm .. X2 ... . Xn Xn-1.. Xn-m+1 How can I do it in R? Thanks!!! -