I have data as such in r:
year category amount
<dbl> <chr> <dbl>
1 2022 Rent 10
2 2022 Grocery 11
3 2023 Rent 8
4 2023 Shopping 9
I would like to make a table as such:
category 2022 2023
Rent 10 8
Grocery 11
Shopping 9
I thought of making my data from either wide to long or vice versa but I am thinking there must be a better way. Thank you.