[R] importing selected rows and columns from text

From: James Root <jcroot_at_gmail.com>
Date: Sun 21 Jan 2007 - 02:53:50 GMT

I read through the import/export manual a few times and did not see this mentioned and checked the archives as well. I am dealing with data sheets generated by Eprime (a software package for generating experimental psychology paradigms) that output subject responses in a proprietary Edat file format. All individual subject response spread sheets can be merged to form one long file of all subjects. As an example, if an experiment has 240 responses per subject (120 for each condition, say), each subject will generate a spreadsheet with 240 rows. After merging 10 subjects then, a merged spreadsheet will have 2400 rows, with each subject's responses starting every 240 rows. Formally being an SPSS user, I would do a datalist command that would pick out the columns and rows of interest, and using a rows command, indicate how many rows were equal to one subject.

Is there an equivalent way to do this directly from a text file to import into R? That is, give R one long spread sheet composed of all subjects' responses, tell R how many rows make up a subject, which rows make up a discrete condition, and import and flag only the data that I need, and then organize these as discrete variables so that each subject will have 240 columns of responses and only one row (instead of 240 rows and one column as in the original text file). Sorry for the long-winded email, and thanks in advance for any help on this.

        [[alternative HTML version deleted]]

R-help@stat.math.ethz.ch 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. Received on Sun Jan 21 14:00:00 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sun 21 Jan 2007 - 12:30:23 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.