Skip to content
Prev 385836 / 398503 Next

how to turn column into column names and fill it with values

Hello,

Sorry, I didn't understand that 1 and 2 are the final values, I thought 
they would be counts of PLATE. I have changed the auxiliary column 
'counts' to 'flag'.


mc %>%
   group_by(PLATE) %>%
   mutate(flag = 2) %>%
   pivot_wider(
     id_cols = c("FID", "IID"),
     names_from = "PLATE",
     values_from = flag,
     values_fill = list(flag = 1)
   )


Hope this helps,

Rui Barradas

?s 19:19 de 29/09/20, Rui Barradas escreveu: