Possible Duplicate:
split and combine by factor into new columns
Using example data here for easier illustrative purposes.
I have the full greek alphabet as my sample set.
I also have the full latin alphabet.
I’m currently working with a table that looks like this. This would be a small subset. My actual data is in the 100s of thousands of rows.
sample call letter
alpha y A
alpha y D
alpha n C
beta y F
beta y B
gamma n F
gamma y B
gamma n A
delta m E
epsilon n F
epsilon n C
epsilon n B
zeta m A
zeta y D
I would like to make a final table where the greek alphabet are rows and the columns are the latin alphabet and I’d only provide the “call” whenever available, otherwise NA or 0 could be the entry.
End result would be something like so.
A B C D E F
alpha y NA n y NA NA
beta NA y NA NA NA y
gamma n y NA NA NA n
delta NA NA NA NA m NA
epsilon NA n n NA NA n
zeta m NA NA y NA NA
Any idea how I could achieve something like this? Even a general pointer into what would be great.
Thanks in advance.
dcastfrom thereshape2package does this nicely