-
From: Phil Spector [mailto:spec...@stat.berkeley.edu]
Sent: Thursday, October 28, 2010 4:59 PM
To: David Herzberg
Cc: r-help@r-project.org
Subject: Re: [R] Determining a basal correct count
David -
I think changing
apply(x,1,function(x)rle(x[which(x==1)[1]:length(x)])$lengths[1])
to
apply(x,1
4:59 PM
To: David Herzberg
Cc: r-help@r-project.org
Subject: Re: [R] Determining a basal correct count
David -
I think changing
apply(x,1,function(x)rle(x[which(x==1)[1]:length(x)])$lengths[1])
to
apply(x,1,function(x)if(!any(x==1)) 0 else
rle(x[which(x==1)[1]:length(x)])$lengths[1
Here's another interesting problem: if you recall I have a data frame (LCvars1)
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
Thank you Phil - I'll give this a try. I do have some empty rows, so I'll have
to deal with that eventually.
Dave
Sent via DROID X
-Original message-
From: Phil Spector spec...@stat.berkeley.edu
To: David Herzberg dav...@wpspublish.com
Cc: r-help@r-project.org r-help@r-project.org
: 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 number of the column
Thank you - I will try this solution as well.
Sent via DROID X
-Original message-
From: Petr PIKAL petr.pi...@precheza.cz
To: David Herzberg dav...@wpspublish.com
Cc: Adrienne Wootten amwoo...@ncsu.edu, r-help@r-project.org
r-help@r-project.org
Sent: Tue, Oct 26, 2010 06:43:09 GMT+00
: (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 set of variables in R
: 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 testmat
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
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 your
I start with:
v1-c(1,3,5,7)
v2-c(2,4,6,8)
And I want to end up with:
v3-c(12,34,56,78)
How do I get there?
Thanks,
David S. Herzberg, Ph.D.
Vice President, Research and Development
Western Psychological Services
12031 Wilshire Blvd.
Los Angeles, CA 90025-1251
Phone: (310)478-2061 x144
FAX:
11 matches
Mail list logo