I have a df that looks like this:
I want to remove the part that is equal to ID from Name, and then build three new variable which equal to the last two digit of Name, the 3 place in Name', and 4th place in Name". sth that will look like the following:
What should I do in order to achieve this goal?
df<-structure(list(Name = c("LABCPCM01", "TUNISCN02", "HONORCN01",
"KUCCLCN02", "LABCPBF03", "LABCPBF04", "MFHLBCM01", "MFHLBCF01",
"DRLLBCN01", "QDSWRCN03", "QDSWRCN04", "UTSWLHN01", "MGHCCBN02",
"JHDPCHM01", "UNILBCF03", "UTSWLGN03", "PHCI0CN01", "PHCI0CN02"
), ID = c("LABCP", "TUNIS", "HONOR", "KUCCL", "LABCP", "LABCP",
"MFHLB", "MFHLB", "DRLLB", "QDSWR", "QDSWR", "UTSWL", "MGHCC",
"JHDPC", "UNILB", "UTSWL", "PHCI0", "PHCI0")), row.names = c(NA,
-18L), class = c("tbl_df", "tbl", "data.frame"))

