I tried to get a view that is based on group by of date by using sqldf package and a month function but I got an error :Error in sqliteSendQuery(con, statement, bind.data)
I suspect you are used to SQL Server, but the sqldf
backend being used in your case is SQLite, where there is no MONTH
function. Try this instead:
R> sqldf("SELECT strftime('%m', dateTime) AS Month
,SUM(wolfs) AS Wolves
FROM df
GROUP BY strftime('%m', dateTime)")
# Month Wolves
# 1 01 6
# 2 02 5
# 3 03 3
# 4 04 12
# 5 05 7
# 6 08 7
# 7 09 7