Hello together, i have probably a easy question, but how can i sum 2 data.frames among each other. I have 2 data.frames which look like this one: Cu.No. place level 1 123 London A 2 111 Paris B Cu.No. place level 1 333 Berlin C 2 444 Madrid A and now i want this data in the same data.frame. like this one: Cu.No. place level 1 123 London A 2 111 Paris B 3 333 Berlin C 4 444 Madrid A how can i do this. Thanks. Mat -- View this message in context: http://r.789695.n4.nabble.com/merge-2-data-frames-tp4657702.html Sent from the R help mailing list archive at Nabble.com.
x<-matrix(c(1,11,11,2,3,4),2,3) y<-matrix(x(7,8,9,10,11,12),2,3) if you want to merge them by row, then use: rbind(x,y) if you want to merge them by column, then use cbind(x,y) hope this can help you out*---- Alice Xiong On Wed, Feb 6, 2013 at 8:55 AM, Mat <matthias.weber@fnt.de> wrote:> Hello together, > > i have probably a easy question, but how can i sum 2 data.frames among each > other. > I have 2 data.frames which look like this one: > > Cu.No. place level > 1 123 London A > 2 111 Paris B > > Cu.No. place level > 1 333 Berlin C > 2 444 Madrid A > > and now i want this data in the same data.frame. like this one: > > Cu.No. place level > 1 123 London A > 2 111 Paris B > 3 333 Berlin C > 4 444 Madrid A > > how can i do this. > > Thanks. > > Mat > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/merge-2-data-frames-tp4657702.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@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. >[[alternative HTML version deleted]]
Hi Mat, just have a look at ?rbind cheers. Am 06.02.2013 15:55, schrieb Mat:> Hello together, > > i have probably a easy question, but how can i sum 2 data.frames among each > other. > I have 2 data.frames which look like this one: > > Cu.No. place level > 1 123 London A > 2 111 Paris B > > Cu.No. place level > 1 333 Berlin C > 2 444 Madrid A > > and now i want this data in the same data.frame. like this one: > > Cu.No. place level > 1 123 London A > 2 111 Paris B > 3 333 Berlin C > 4 444 Madrid A > > how can i do this. > > Thanks. > > Mat > > > > -- > View this message in context: http://r.789695.n4.nabble.com/merge-2-data-frames-tp4657702.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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. >-- Eik Vettorazzi Department of Medical Biometry and Epidemiology University Medical Center Hamburg-Eppendorf Martinistr. 52 20246 Hamburg T ++49/40/7410-58243 F ++49/40/7410-57790 -- Pflichtangaben gem?? Gesetz ?ber elektronische Handelsregister und Genossenschaftsregister sowie das Unternehmensregister (EHUG): Universit?tsklinikum Hamburg-Eppendorf; K?rperschaft des ?ffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Martin Zeitz (Vorsitzender), Dr. Alexander Kirstein, Joachim Pr?l?, Prof. Dr. Dr. Uwe Koch-Gromus