Connect tables in R

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Connect tables in R

Happyglider
Hi all,

I'm new to R and would like to know how i can connect two tables/matrixes (e.g. through use of a key). I tried googling my question, but unfortunately wasn't successful. I'd be very happy if somebody could help me. If the question is too simple and was answered somewhere else, which I didn't find, just post the link. :)

Here's my question:
I have two tables. The tables where inserted into R from excel. One table is filled with soccer players, another one with soccerclubs. In the first table, soccer players are listed. Each player has an ID, a name, age and nationality. The second table lists soccerclubs. Of course players compete for the club, therefore the the IDs of the players are listed also in the second table. Furthermore the second table states, which kind of nutrition products the players of a club use.
I now want to collect information from the two tables. For example I want to find out, whether players from a certain age group or a certain nationality prefere different nutrition products than older/younger players from another country.

If I'm correct, I need to connect the two tables in a first step (but I don't know how to do that in R) and then need to collect the information in a second step. I could do that with the help of MS Access, but my university wants me to solve the problem with R.

I hope you understand my question, as I probably described it quite complicatedly (english is not my first language). Still, I hope, that someone can help me.

Looking forward to some answers and thank you in advance, for your help,
Happyglider
Reply | Threaded
Open this post in threaded view
|

Re: Connect tables in R

glaporta
Hi,
I could suggest two ways to do that:
?merge or install the package sqldf that includes all the functions of sql language.

All the best,
Gianandrea