Re: [R] Conditional looping over a set of variables in R

2010-10-27 Thread Peter Ehlers
7838 email: dav...@wpspublish.com -Original Message- From: Peter Ehlers [mailto:ehl...@ucalgary.ca] Sent: Tuesday, October 26, 2010 9:23 AM To: David Herzberg Cc: Petr PIKAL; r-help@r-project.org Subject: Re: [R] Conditional looping over a set of variables in R I would still

Re: [R] Conditional looping over a set of variables in R

2010-10-27 Thread David Herzberg
.ca] Sent: Tuesday, October 26, 2010 9:23 AM To: David Herzberg Cc: Petr PIKAL; r-help@r-project.org Subject: Re: [R] Conditional looping over a set of variables in R I would still recommend vector_of_column_number <- apply(yourdata, 1, match, x=1) as the simplest way if you only want the

Re: [R] Conditional looping over a set of variables in R

2010-10-26 Thread Peter Ehlers
43:09 GMT+00:00 Subject: Re: [R] Conditional looping over a set of variables in R Hi r-help-boun...@r-project.org napsal dne 25.10.2010 20:41:55: Adrienne, there's one glitch when I implement your solution below. When the loop encounters a case with no data at all (that is, all 140 item

Re: [R] Conditional looping over a set of variables in R

2010-10-26 Thread David Herzberg
Thank you - I will try this solution as well. Sent via DROID X -Original message- From: Petr PIKAL To: David Herzberg Cc: Adrienne Wootten , "r-help@r-project.org" Sent: Tue, Oct 26, 2010 06:43:09 GMT+00:00 Subject: Re: [R] Conditional looping over a set of variables i

Re: [R] Conditional looping over a set of variables in R

2010-10-25 Thread Petr PIKAL
drie...@gmail.com] On Behalf > Of Adrienne Wootten > Sent: Friday, October 22, 2010 9:09 AM > To: David Herzberg > Cc: r-help@r-project.org > Subject: Re: [R] Conditional looping over a set of variables in R > > David, > > here I'm referring to your data as testmat

Re: [R] Conditional looping over a set of variables in R

2010-10-25 Thread David Herzberg
10)478-2061 x144 FAX: (310)478-7838 email: dav...@wpspublish.com From: wootten.adrie...@gmail.com [mailto:wootten.adrie...@gmail.com] On Behalf Of Adrienne Wootten Sent: Friday, October 22, 2010 9:09 AM To: David Herzberg Cc: r-help@r-project.org Subject: Re: [R] Conditional looping over a s

Re: [R] Conditional looping over a set of variables in R

2010-10-24 Thread Gabor Grothendieck
On Sun, Oct 24, 2010 at 2:54 PM, Peter Ehlers wrote: > Whoops, got an extra comma in there somehow; should be: > >  apply(d, 1, function(x) match(1, x)) > A slight variation on this would be: apply(d, 1, match, x = 1) -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel:

Re: [R] Conditional looping over a set of variables in R

2010-10-24 Thread Peter Ehlers
geles, CA 90025-1251 Phone: (310)478-2061 x144 FAX: (310)478-7838 email: dav...@wpspublish.com -Original Message- From: William Dunlap [mailto:wdun...@tibco.com] Sent: Friday, October 22, 2010 9:52 AM To: David Herzberg; r-help@r-project.org Subject: RE: [R] Conditional looping over a s

Re: [R] Conditional looping over a set of variables in R

2010-10-24 Thread Peter Ehlers
n...@tibco.com] Sent: Friday, October 22, 2010 9:52 AM To: David Herzberg; r-help@r-project.org Subject: RE: [R] Conditional looping over a set of variables in R You were a bit vague about the format of your data. I'm assuming all columns were numeric and the entries are one of 0, 1, and NA (

Re: [R] Conditional looping over a set of variables in R

2010-10-23 Thread David Herzberg
: wootten.adrie...@gmail.com [mailto:wootten.adrie...@gmail.com] On Behalf Of Adrienne Wootten Sent: Friday, October 22, 2010 9:09 AM To: David Herzberg Cc: r-help@r-project.org Subject: Re: [R] Conditional looping over a set of variables in R David, here I'm referring to your data as testm

Re: [R] Conditional looping over a set of variables in R

2010-10-22 Thread David Herzberg
-7838 email: dav...@wpspublish.com -Original Message- From: William Dunlap [mailto:wdun...@tibco.com] Sent: Friday, October 22, 2010 9:52 AM To: David Herzberg; r-help@r-project.org Subject: RE: [R] Conditional looping over a set of variables in R You were a bit vague about the format of

Re: [R] Conditional looping over a set of variables in R

2010-10-22 Thread William Dunlap
time in seconds user system elapsed 0.080.000.08 Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of David Herzberg > Sent: Friday, Octob

Re: [R] Conditional looping over a set of variables in R

2010-10-22 Thread Adrienne Wootten
David, here I'm referring to your data as testmat, a matrix of 140 columns and 1500 rows, but the same or similar notation can be applied to data frames in R. If I understand correctly, you are looking for the first response (column) where you got a value of 1. I'm assuming also that since your m

[R] Conditional looping over a set of variables in R

2010-10-22 Thread David Herzberg
Here's the problem I'm trying to solve in R: I have a data frame that consists of about 1500 cases (rows) of data from kids who took a test of listening comprehension. The columns are their scores (1 = correct, 0 = incorrect, . = missing) on 140 test items. The items are numbered sequentially a