Dear R experts,
I would like to pass text content as function and produce another column.
Here is my data:
var1 var2 var3 input rule result
a d g "var1,var2" "a d"
b e h "var2,var3" "e h"
c f i "var1,var2,var3" "c f i"
I want to put the content in var1, var2, var3 together base on the rule in “input rule” column and produce “result” column. Take the first row of my data as an example, I want to produce “result” column like result=paste(var1,var,sep= ‘ ‘). How can I achieve this without write paste function for each row. Suggestions will be appreciated, Thanks.