Re: [R] How to 'de-cross' a table?

From: Charles Plessy <charles-r-nospam_at_plessy.org>
Date: Sat 04 Jun 2005 - 01:31:23 EST

On Fri, Jun 03, 2005 at 04:33:44PM +0200, Sander Oom wrote :
> Dear R users,
>
> I have received a table in the following format:
>
> id a b c1 c2 d1 d2
> 1 1 1 65 97 78 98
> 2 1 2 65 97 42 97
> 3 2 1 65 68 97 98
> 4 2 2 65 97 97 98
>
> Factors of the design are: a, b, and e, where e has levels c and d. The
> levels c and d then have 2 replicates (r) each.
>
> Now I would like to get:
>
> id a b e r value
> 1 1 1 c 1 65
> 2 1 1 c 2 97
> 3 1 1 d 1 78
> 4 1 1 d 2 98

I think that "reshape" is the tool you are looking for.

-- 
Charles

______________________________________________
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
Received on Sat Jun 04 01:35:25 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:22 EST