SyntaxFix
Write A Post
Hire A Developer
Questions
This is a simple solution with the function aggregate:
aggregate
aggregate(order_no ~ name, myvec, function(x) length(unique(x)))