I met some problems in R, please help me.
1. How to do a intersect operation among several groups in one list, without a loop statement? (I think It may be a list)
I want to get intersection of product between every year. I know the basic is:
this will give the correct answer:
above code lacks reusability, so It should use a for loop:
It's correct too, but stll too complex, so my question is:
Can I do the same thing just use another similar intersect function (without for/repeat/while).
What's this simple function's name ?
2.how to do a relative computation after split (notice: not befor split)?
I want compute relative value in the every group, what I mean is , I want get the result is just like below:
I think to use a loop maybe work, but Is there no direct method on list?
3.how to do a sorting after split, It's just like above question, what I want is sorting by value:
4. how to do a filtering after split, Yes, It's just like above quetion, what I want is filtering out data which value is more than 1000: