Hi, I Have a new question. With this dataframe
dataf <- data.frame(
stringsAsFactors = FALSE,
MUN = c("02006 ALCADOZO",
"02007 ALCALA DEL JUCAR","02008 ALCARAZ","02009 ALMANSA",
"02010 ALPERA","02011 AYNA","02012 BALAZOTE",
"02013 BALSA DE VES","02021 CASAS DE JUAN NUEZ","02022 CASAS DE LAZARO",
"02023 CASAS DE VES"),
REG = c(22, 214, 182, 6.478, 198, 51, 589, 28, 171, 11, 39)
)
I'm trying to separate the "MUN" column in two ("COD" and "MUN"). I use:
dataf <- dataf %>% separate(MUN, into = c("COD", "MUN"), sep = " ", remove = TRUE, convert = FALSE)
But then the MUN column is cut off, I mean, get this (02007 | ALCALA) instead of (02007 | ALCALA DEL JUCAR), which is what I want.
Any idea? Thank you all