s-news
[Top] [All Lists]

Column Manipulation

To: s-news@lists.biostat.wustl.edu
Subject: Column Manipulation
From: "Overstreet, Jason (FL51)" <Jason.Overstreet@honeywell.com>
Date: Thu, 15 Dec 2005 08:25:23 -0700

I have several "pairs" of columns that are of different lengths.  I was wondering the following:

How do you stack these pairs of columns atop one another and have a third column that serves as a group identifier that assumes uses the identity of the Columns 2, 4, and 6 respectively.  I would like this in a data frame. I am trying to write this within the frame work of a function. 

For Example:

This is what I have:

Col1    Col2

1       12
2       23
3       54
4       23
5       34
6       32

Col3    Col4

1       32
2       34
3       32
4       23

Col5    Col6

2       31

4       32

6       24

This is what I want

New.Col1        New.Col.2       New.Col.312

1               12              Col2

2               23              Col2

3               54              Col2

4               23              Col2

5               34              Col2

6               32              Col2

1               32              Col4

2               34              Col4

3               32              Col4

4               23              Col4

2               31              Col6

4               32              Col6

6               24              Coll6

 

It seems I have the most difficulties in simply manipulating the data...


Jason Overstreet

Statistician

Honeywell DSES

(727) 539-3964

<Prev in Thread] Current Thread [Next in Thread>
  • Column Manipulation, Overstreet, Jason (FL51) <=