I need some help with r.
I have a data frame:
ant <- data.frame(n_scale = c(0.62, 0.29, -0.9),
aa = c('A','B','C'))
It looks like this:
0.62 A
0.29 B
-0.90 C
Then I read a file with a dataframe2 which looks like:
-1 0 1 2
C B A A
I want to achieve this:
-1 0 1 2
C B A A
-0.9 0.29 0.62 0.62
How can I loop through the dataframe2 to get values from the ant data frame?
Thank you very much for your help! :)