Re: [R] Joining data frames

2021-06-29 Thread Jeff Newmiller
To expand on this for people submerged in tidyverse, merge is the base R swiss army knife that performs the in-memory functions of dplyr::inner_join dplyr::left_join dplyr::right_join dplyr::full_join but it does not support databases and the like. On June 29, 2021 5:07:46 PM PDT, Dunca

Re: [R] Joining data frames

2021-06-29 Thread Duncan Murdoch
On 29/06/2021 8:03 p.m., Matthew McCormack wrote:     I think, but I'm not sure, that when you use merge it basically attaches one data frame to the other. I do not think it matches up entries from a particular column in each data frame (and I know biologists frequently want to match entries fr

Re: [R] Joining data frames

2021-06-29 Thread Matthew McCormack
    I think, but I'm not sure, that when you use merge it basically attaches one data frame to the other. I do not think it matches up entries from a particular column in each data frame (and I know biologists frequently want to match entries from a particular column in each data frame). For th

Re: [R] Joining data frames

2021-06-29 Thread Jim Lemon
Hi Esthi, Have you tried something like: df2<-merge(df,df1,by.x="Sample",by.y="Plot",all.y=TRUE) This will get you a right join in "df2", not overwriting "df". Jim On Wed, Jun 30, 2021 at 1:13 AM Esthi Erickson wrote: > > Hi and thank you in advance, > > If I have a dataframe, df: > > Sample >

Re: [R] Joining data frames

2021-06-29 Thread Greg Minshall
hi. i would suggest re-formatting your message as plain text (not HTML), and re-sending it. this list strips out HTML content, and the plain text version you sent is close to illegible. cheers, Greg __ R-help@r-project.org mailing list -- To UNSUBSCRI

Re: [R] Joining data frames

2021-06-29 Thread Bert Gunter
This is a plain text list: do not post in HTML -- it can get mangled, as here (see quoted text below). Also, you have not posted a reprex; doing so would make it more likely that you get a helpful reply. Anyway, I *think* you may want a full outer join, which, In base R, is simply given by: new

Re: [R] Joining data frames

2021-06-29 Thread Jeff Newmiller
1) Compare the text below that the mailing list sent us to what you saw when you sent your post... this occurred because you did not follow the instructions in the Posting Guide that tell you to send plain text email... the mailing list strips formatting. Note that there are far too many email c

[R] Joining data frames

2021-06-29 Thread Esthi Erickson
Hi and thank you in advance, If I have a dataframe, df: Sample Plot Biomass 1 1 1024 1 2 32 2 3 223 2 4 456 3 1 3 2 331 3 3 22151 3 4 1441 And another one, df1: Sample Plot % cover of plant1 % cover of plant2 3 1 32 63 3 2 3 3 3 3 3 4 5 23 I want to