I have a dataframe with a post stratification survey weight variable “n”. For an analysis purpose I will need this data frame where each row will represent an observation.
How do I get a new (i.e., long) dataframe?
structure(list(grupo = structure(c(1L, 1L, 1L, 1L), .Label = c("A",
"B"), class = "factor"), Categorias = structure(c(1L, 1L, 2L,
2L), .Label = c("7 a 10 anos", "11 a 15 anos", "16 a 21 anos",
"Adulto"), class = "factor"), Atuacao = structure(c(1L, NA, 1L,
3L), .Label = c("Não", "NA", "Sim"), class = "factor"), n = c(16L,
2L, 14L, 2L)), row.names = c(NA, -4L), class = c("tbl_df", "tbl",
"data.frame"))