[R] Merging nested files

Gabor Grothendieck ggrothendieck at gmail.com
Sun Nov 2 18:38:35 CET 2008


Read them into data frames and then use the R sqldf package:
http://sqldf.googlecode.com


On Sun, Nov 2, 2008 at 12:04 PM, David Kaplan
<dkaplan at education.wisc.edu> wrote:
> Greetings all,
>
> I have three files that I would like to merge.  The first is a student level
> file that contains the student ID, their school ID, and their country ID.
>
> The second is the school file that contains the school ID and country ID.
>
> The third is the country file with a country ID.
>
> I would like to merge the three together using the common country ID.  Of
> course, what this would mean is that school data be repeated for every
> student in their school, and country data repeated for every school and
> student in that country.
> Any direction would be helpful.
>
> Thanks in advance,
>
> David
>
>
> --
> =======================================================================
> David Kaplan, Ph.D.
> Professor
> Department of Educational Psychology
> University of Wisconsin - Madison
> Educational Sciences, Room, 1061
> 1025 W. Johnson Street
> Madison, WI 53706
>
> email: dkaplan at education.wisc.edu
> homepage:
> http://www.education.wisc.edu/edpsych/default.aspx?content=kaplan.html
> Phone: 608-262-0836
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list