I have a dataset that has ID number, primary info, secondary info in R language using loops only. I need to create two new columns that takes values from primary info and secondary info. For example from this table(data) I have to get the second one:
- Initial data:
- What I need: