R lapply and unique -
i have list of dataframes called test , trying lowest ranking of month per accountid using lapply , unique. current code looks this, throwing error. causing problem?
test_1 <- lapply(test, function(x) unique(x[,list(x$ranking = min(x$ranking), x$month), = x$accountid]))
when working 1 datatable (one datable 1 month), code below worked fine.
best_rank_mar <- unique(rank_mar[,list(ranking=min(ranking), month), = accountid])
Comments
Post a Comment