I dont know why, but I obtain a messy result using the reshape function, I have already tried with other answers, but I don't know why my solution is not working
df <- data.frame(design = c("house", "house", "car","car", "plane","plane"),
who = c("creator1", "creator2", "creator1", "creator2",
"creator1", "creator2"),
how_many = c(3, 6, 1, 7, 8, 2))
I tried with
tidyr::spread(data = df, value=design , key = who)
The results that I have is:
how_many creator1 creator2
1 1 car <NA>
2 2 <NA> plane
3 3 house <NA>
4 6 <NA> house
5 7 <NA> car
6 8 plane <NA>
I want to create a dataframe with this format:
Design creator1 creator2
house 3 6
car 1 7
plane 8 2