I'm trying to create a new data frame from existent data frames:
My new data frame (new_dataframe
) will contain monthly purchased quantities of a specific year (2017) of two specific categories (c1 and c2). Knowing that, my other data frames are:
- df1 = client_data (clientId, city, category)
- df2 = purchase_data (clientId, quantity, price, purchase_date)
I've tried with substract()
and aggregate()
but it didn't work for me.
For instance to get data of the specific year (just a part of the solution), I used this code:
new_dataframe <- subset(
AllInfosClients,
AllInfosClients$Date_achat == as.Date(AllInfosClients$Date_acha,"%d/%m/2017")
)
Any help will be appreciated.