On Mon, 30 May 2011 16:47:45 -0500,
"Mendolia, Franco" wrote:
> Hello, I would like to create a group variable that is based on the
> values of three variables:
> For example,
>> dat <- data.frame(A=c(1,1,1,1,1,2,2,2,2,2),
> B=c(1,1,1,5,5,5,9,9,9,9),
> C=c(1,1,1,1,1,2,2,7,7,
Hi,
There are probably much better ways, but try this
transform(dat, group = as.numeric(factor(paste(A,B,C, sep=""
HTH,
baptiste
On 31 May 2011 09:47, Mendolia, Franco wrote:
> Hello,
>
> I would like to create a group variable that is based on the values of three
> variables:
>
> For ex
Hello,
I would like to create a group variable that is based on the values of three
variables:
For example,
> dat <- data.frame(A=c(1,1,1,1,1,2,2,2,2,2),
B=c(1,1,1,5,5,5,9,9,9,9),
C=c(1,1,1,1,1,2,2,7,7,7))
> dat
A B C
1 1 1 1
2 1 1 1
3 1 1 1
4
3 matches
Mail list logo