Skip to content
Prev 311765 / 398503 Next

Building factors across two columns, is this possible?

To clarify on my previous post, here is a representation of what I am trying to accomplish:

I would like every unique value in either column to be assigned a number so like so:

    V1    V2       V3
1   sun  moon    stars
2 stars  moon      sun
3   cat   dog   catdog
4   dog  moon      sun
5  bird plane superman
6  1000   dog     2000

Level			Value
sun			->	0
stars		->	1
cat			->	2
dog			->	3
bird			->	4
1000		->	5
moon		->	6
plane		->	7
catdog		->	8
superman	->	9
2000		->   10
etc
etc

so internally its represented as:

    V1    V2       V3
1   0		6	1
2   1		6	0
3   2		3	8
4   3		6	0
5   4		7	9
6   5		3	10

does this make sense?  I am hoping there is a way to accomplish this.

Brian
On Nov 23, 2012, at 11:42 PM, Brian Feeny <bfeeny at mac.com> wrote: