Why does using bind_rows don't run in show_query()
Using data.table
you may write this operation as -
library(data.table)
setDT(dt)
rbind(dt[, .(Value = sum(Value), Item = "Total"), Year], dt)
# Year Value Item
#1: 2015 3104143 Total
#2: 2016 3183862 Total
#3: 2017 3644412 Total
#4: 2015 884688 Soybeans
#5: 2016 829166 Soybeans
#6: 2017 960640 Soybeans
#7: 2015 2219455 Pulses, Total
#8: 2016 2354696 Pulses, Total
#9: 2017 2683772 Pulses, Total