0

I have this data set right there that I need to aggregate

aggregate(credit$Amount~credit$`Transaction Date`,credit,sum)

I tried that code but it has been giving me only the totals amount of March and February whereas I need the amounts of March and February broken out by categories like food & drink and travel.

jchang
  • 1
  • 1
    You can sum using two different categories by including them inside the list like this `aggregate(credit, by = list(credit$Transaction Date, credit$another category), FUN = sum)` – XXavier Apr 19 '20 at 03:18
  • Please do not post an image of code/data/errors: it cannot be copied or searched (SEO), it breaks screen-readers, and it may not fit well on some mobile devices. Ref: https://meta.stackoverflow.com/a/285557 (and https://xkcd.com/2116/). Please just include the code, console output, or data (e.g., `dput(head(x))` or `data.frame(...)`) directly. – r2evans Apr 19 '20 at 03:47

0 Answers0