1
I have a variable named STATUS where the answers are inserted like this:
IDENTIFICADOR ESTADO
1 MG / SP
2 RJ / BA
I need to adjust to:
IDENTIFICADOR ESTADO
1 MG
1 SP
2 RJ
2 BA
What is going on? What you really hope will happen?
– Boneco Sinforoso
To me it’s pretty clear what he wants. Just separate a list into a column into rows, using the
tidyr
just dodf <- separate_rows(df, ESTADO)
. Anything looks here at a complete example: https://tidyr.tidyverse.org/reference/separate_rows.html– Umo
But using tidyr it would keep the transponders while separating my status column?
– Francisco1988
df %>% mutate(STATE=strsplit(STATE, "/")) %>% unnest(STATE) CONSEGUI!!!!!
– Francisco1988