This is the dataset
df1 <- data.frame("id" = c("ebi.ac.uk:MIAMExpress:Reporter:A-MEXP-503.100044",
"ebi.ac.uk:MIAMExpress:Reporter:A-MEXP-783.100435",
"ebi.ac.uk:MIAMExpress:Reporter:C-DEA-783.100435"),
"Name" = c("ABC", "DEF", ""))
The product of the dataset
id Name
1 ebi.ac.uk:MIAMExpress:Reporter:A-MEXP-503.100044 ABC
2 ebi.ac.uk:MIAMExpress:Reporter:A-MEXP-503.100435 DEF
3 ebi.ac.uk:MIAMExpress:Reporter:A-MEXP-503.100488
I want to make the dataframe look like this
id Name
1 100044 ABC
2 100435 DEF
3 100488 NA
Can anyone show me how to approach this problem?