Re: [R] Loop through each subject

2011-06-28 Thread StellathePug
> for (i in 1:(dat[(unique(dat$Subject)),)] I don't think the order of the parentheses when you open the loop is correct. You have four (s and only three )s. Plus the brackets (square parentheses) seem so be out of order too. If you use RStudio to write your code, when you highlight a parenthe

Re: [R] Loop through each subject

2011-06-28 Thread David Winsemius
On Jun 28, 2011, at 2:51 PM, Edward Patzelt wrote: Huh, not sure I understand your feedback. There is only 1 file that is 1 large dataframe. I want to execute the commands on each subject in the dataframe and ouput their respective files with the subject # and file type appended (10_gre

Re: [R] Loop through each subject

2011-06-28 Thread Edward Patzelt
Huh, not sure I understand your feedback. There is only 1 file that is 1 large dataframe. I want to execute the commands on each subject in the dataframe and ouput their respective files with the subject # and file type appended (10_green.txt). How would I do this loop index? - Show quoted text

Re: [R] Loop through each subject

2011-06-28 Thread David Winsemius
On Jun 28, 2011, at 1:44 PM, Edward Patzelt wrote: R help - I am attempting to write a script that has multiple subjects in 1 data file. Each subject has multiple rows with columns as variables. Here is my code, I am having problem executing it on each unique subject id (dat $Subject).

[R] Loop through each subject

2011-06-28 Thread Edward Patzelt
R help - I am attempting to write a script that has multiple subjects in 1 data file. Each subject has multiple rows with columns as variables. Here is my code, I am having problem executing it on each unique subject id (dat$Subject). getwd() setwd("/Users/edwardpatzelt/Desktop/Neuroimaging