I have a data frame with 3 columns (Animal, Var1, Var2) and 3 rows (1 each for mouse, cat and dog):
Animal Var1 Var2
Mouse 5 5.5
Cat 7 7.4
Dog 1 6.3
I want it to look like this:
Mouse.Var1 Mouse.Var2 Cat.Var1 Cat.Var2 Dog.Var1 Dog.Var2
5 5.5 7 7.4 1 6.3
I have been trying to use reshape and reshape2 but neither seem to work. Please help.