Eu tenho um dataframe parecido com este:
structure(list(Date = structure(c(18876, 18878, 18876, 18878,
18876, 18878), class = "Date"), effort = c(2371.5, 1950.66666666667,
6107.25, 3318.66666666667, 4154.83867521367, 2073.10096153846
), type = c("aerial", "aerial", "TLAcmeth", "TLAcmeth", "TLAmeandaily",
"TLAmeandaily")), row.names = c(NA, -6L), class = c("tbl_df",
"tbl", "data.frame"))
Como posso transpor esse data frame para ter quatro colunas uma para a data e uma para cada "tipo", deve ficar assim:
Data | aéreo | TLAcmeth | TLAmeandaily |
---|---|---|---|
06/09/2021 | 2371,5 | 6107.25 | 4154.839 |
08/09/2021 | 1950.667 | 3318.667 | 2073.101 |
Use a função pivot_wider