I have what seems a simple requirement, but I can't seem to achieve the desired result. My dataframes are rather large, so I will just give a screenshot:
What I want is: if ps2c$ps == present2$pn then ps2c$sf == present2$sf
.
If it is not clear, for every ps2c$ps
there is a present2$pn
(present2 is just the mean data).
You don't supply test data, but something like the following might work:
ps2c$sf <- present2$sf[match(ps2c$ps, present2$pn)]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With