我正在尝试按天和名称汇总值,在那天之后列将错误的日期作为数字
Day name value
02-09-2015 1 2
02-09-2015 2 4
02-09-2015 5 6
02-09-2015 6 8
02-09-2015 6 10
02-09-2015 7 12
02-09-2016 13 14
02-09-2016 14 16
library(lubridate)
df$Day <- mdy(df$Day)
tp=sqldf("select Day ,name ,avg(value) as value from df group by Day,name")
Day name value Correct_day_num
16475 1 2 42249
16475 2 4 42249
16475 5 6 42249
16475 6 9 42249
16475 7 12 42249
16840 13 14 42615
16840 14 16 42615
请建议任何修改