I have a question regarding to addition of rows from different tables having same column names. I have time series of two tables with values 8760 rows (whole year).
Table1
Name Year Month Day Hour Value
Plant_1 2020 1 1 1 10
Plant_2 2020 1 1 1 20
Plant_3 2020 1 1 1 30
Plant_1 2020 1 1 2 40
Plant_2 2020 1 1 2 50
Plant_3 2020 1 1 2 60
Table2
Name Year Month Day Hour Value
Plant_x 2020 1 1 1 1
Plant_y 2020 1 1 1 2
Plant_z 2020 1 1 1 3
Plant_x 2020 1 1 2 4
Plant_y 2020 1 1 2 5
Plant_z 2020 1 1 2 6
What I want is, summation of value of all plants at same time period like
Year Month Day Hour Value
2020 1 1 1 66
2020 1 1 2 165
I don't care about name of plant but need to get sum of total value at each hour of the year. I was trying to do something like this but doesn't work for tables more than two and I have 9 to 10 such tables. Could anyone help me to improve this code or any other function which I can use?
SumOfValue <- Table1%>%
full_join(Table2) %>%
group_by (Year,Month,Day,Hour) %>%
summarise(Value=sum(Value))
Any help would be appreciated. Thank you.