I have a dataset called KID, with a column STRATA with a 4-digit numbers(nnnn). Each digit signifies different characteristics( geography, size, type etc) of the hospital depending on the position of number and its value. For example:
KID$STRATA <- c(4231, 2321, 3133, 2112, 3212)
1st Digit = Geographic location : Northeast (1), Midwest (2), South (3), West (4)
2nd Digit = Control: Government (1), Private, not-for-profit (2), Private, investor-owned (3), Private, either not-for-profit or investor-owned (4)
3rd Digit = Location / Teaching: Rural (1), Urban nonteaching (2), Urban teaching (3)
4th Digit = Bedsize: Small (1), Medium (2), Large (3)
Is there a way to separate each digit(first digit into a new column, second digit into a different column, similarly for third and fourth) into different columns and rename them according to their characteristics?