Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem about set operation and computation after split in R language

 
bird best
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
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)
create data:
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)?
create data:

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:
 
bird best
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anyone help me?
 
Campbell Ritchie
Sheriff
Posts: 48445
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Maybe nobody can help, sorry. Maybe nobody around here knows R. If you find another forum, feel free to post, but be sure to tell them you posted here, too.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic