Creating a series of vectors from a vector
Posted
by bluetongue
on Stack Overflow
See other posts from Stack Overflow
or by bluetongue
Published on 2010-04-07T04:40:14Z
Indexed on
2010/04/07
4:43 UTC
Read the original article
Hit count: 130
I have a simple two vector dataframe (length=30) that looks something like this:
> mDF
Param1 w.IL.L
1 AuZgFw 0.5
2 AuZfFw 2
3 AuZgVw 74.3
4 AuZfVw 20.52
5 AuTgIL 80.9
6 AuTfIL 193.3
7 AuCgFL 0.2
8 ...
I'd like to use each of the rows to form 30 single value numeric vectors with the name of the vector taken from mDF$Param1, so that:
> AuZgFw
[1] 0.5
etc
I've tried melting and casting, but I suspect there may be an easier way??
Thanks in advance
BT
© Stack Overflow or respective owner