I have three columns (cross_type, parent_cross_ID, and transplant_ID). I want to join the cross_type and parent_cross_ID columns, but I want to add a consecutive number at the end (behind either an underscore or a period). I have five crosstypes and am only keeping one type that would require this so I want it to generate a specific transplant_ID only when the cross_type column is one of the five crosstypes.
| Transplant ID | crosstype | parent_cross_ID |
|---|---|---|
| FF_31_1 | FF | 31 |
| FF_31_2 | FF | 31 |
| FA | 34 | |
| FF_31_3 | FF | 31 |
| FC | 23 | |
| FF_40_4 | FF | 40 |
| FF_40_5 | FF | 40 |
| CF | 50 | |
| AF | 55 |
Hopefully, that helps to visualize what I mean. When the cross is "FF", I want to generate a unique transplant ID from the crosstype column and the parent_cross_ID with a unique, but consecutive number at the end.
When there's any other crosstype, it doesn't have to generate a unique transplant_ID because I don't need anything beyond their germination location for those four crosstypes. The FF crosses are the only ones that need a unique transplant ID.
I've tried using some combinations of "join", "sequence" and "if", but it keeps giving me back errors so I must be doing something wrong.
Thank you in advance!