@Jaap IMO, it is unfair on OP and answerer as well. The question does not have reproducible example but it is clear from the title what OP wants to do. Besides, with that generalised title there might be so many people who could have landed on that question. As far as answer is concerned, the answerer never tried to hide that he has "copied" the answer, maybe they are not aware about it and we could have made it clear to them by commenting.
I know: x <- sapply(y, function(i) blabla(i)) and then use x !! I don't understand why nobody thought of just assigning the result to a variable to make it less verbose to use afterwards ;-p
@Tensibai I was just joking, it wasn't meant to be real code ;-p
:'D
verbosity is to be encouraged. better to wrap this whole call to sapply(x, function(x)x) into a function called run_identity_function_on_all_elements — Spacedman16 mins ago
@RomanLuštrik why ? don't you find it "opinion-based"? Imo it is totally : it's referring to how people want to code / what are their preferences, etc. to it will depend on people (not sure I'm being very clear but I guess you see the point)
They have a clear goal of how to make things less verbose. They are not asking whether this is fine or not, even though that's how we're answering it. :)
@RomanLuštrik I agree on that, I reread the question and it's not giving an opinion or asking for it. Nevertheless the essence of the question is bound to getting opinion-based answers...
there is no "opinion-based" flag for answers ;-). I guess this question is on the verge of being opinion-based and when you ask yourself "why do they want this?" then you dive into an opinion-based debate
^^^ I'm actually not sure whether this should be a duplicate. The problem is the inverse of the duplicated problem and can be solved using by changing an == to a > in the accepted answer
but other answers use the newer distinct function, which doesn't allow the inverse