Skip to content
Advertisement

Joining two dataframes which have variable names as values in R / SQL

I am using R

I am trying to join two which look like this:

 
DF1: 

Name Species Value Variable_id 
Jake Human   99    1
Jake Human   20    2
Mike Lizard  12    1
Mike Lizard  30    2


DF2:

Variable_id Varible_name
1           Height
2           Age

And I need it in the form of

Name Species Height Age
Jake Human   99     20
Mike Lizard  12     30

Advertisement

Answer

Using this data:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement