I have data frame with 10 columns for this data frame I am trying to get count over year
and val_1
with below formula. Which I am getting error as
"unused argument (by = year)" in data.table
year val_1 . . . . . val_50
2012 A . . . . . 23
2013 B . . . . . 43
I have tried to get output with below code:
df$cnt = df[,.N,by=year,val_1 ]
How should I modify the above code?