Re: [R] Combining data.frames

2022-03-20 Thread Rui Barradas
bc123","abc456","abc123","abc789","abc890","w12345")), event = as.factor(c("shoting","ied","protest","riot","protest","killing"))) df1 df2 #df3 <- merge(df1, df2

Re: [R] Combining data.frames

2022-03-19 Thread Bert Gunter
tax issue - wrong "all" argument (I > > think) > > > > -Original Message- > > From: Tom Woolman > > Sent: Saturday, March 19, 2022 8:27 PM > > To: reichm...@sbcglobal.net > > Cc: r-help@r-project.org > > Subject: Re:

Re: [R] Combining data.frames

2022-03-19 Thread Jeff Newmiller
what I need. Could maybe the way to to and it might be my syntax > >-Original Message- >From: Tom Woolman >Sent: Saturday, March 19, 2022 8:20 PM >To: reichm...@sbcglobal.net >Cc: r-help@r-project.org >Subject: Re: [R] Combining data.frames > >Have you looked at

Re: [R] Combining data.frames

2022-03-19 Thread Jeff Reichman
:51 PM To: reichm...@sbcglobal.net; Jeff Reichman ; 'Tom Woolman' Cc: r-help@r-project.org Subject: Re: [R] Combining data.frames Then show your code so we can focus on what you haven't yet figured out. Have you read the examples in the merge help page? On March 19, 2022 6:23:02 PM PDT, J

Re: [R] Combining data.frames

2022-03-19 Thread Jeff Reichman
Yes I'm reading that presently The closest I've gotten has been df3 <- merge(df1, df2, all = TRUE) -Original Message- From: Tom Woolman Sent: Saturday, March 19, 2022 8:27 PM To: reichm...@sbcglobal.net Cc: r-help@r-project.org Subject: Re: [R] Combining data.frames You can also

Re: [R] Combining data.frames

2022-03-19 Thread Tom Woolman
Have you looked at the merge function in base R? https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/merge On 2022-03-19 21:15, Jeff Reichman wrote: R-Help Community I'm trying to combine two data.frames which each containing 10 columns of which they each share two common

Re: [R] combining data.frames with is.na & match (), two questions

2019-04-23 Thread PIKAL Petr
Hi Keep posts also to r-help, others could give you different/better solutions. Regarding ordering, see ?order or ?sort. However this is mainly necessary only for plotting or exporting data. Cheers Petr From: Drake Gossi Sent: Thursday, April 18, 2019 9:27 PM To: PIKAL Petr Subject: Re: [R

Re: [R] combining data.frames with is.na & match (), two questions

2019-04-18 Thread Eric Berger
Hi Drake, Petr's suggestion to use the merge() function is good. Another (possibly overkill) approach is to use functions from the dplyr package, which is a fantastic package to get familiar with. For example, the last alternative that Petr suggests is an example of what is called a "left join"

Re: [R] combining data.frames with is.na & match (), two questions

2019-04-18 Thread PIKAL Petr
Hi I wonder why such combination is so complicated in your text book. Having data frames fr1 and fr2 > dput(fr1) structure(list(Fruit = structure(c(1L, 3L, 2L), .Label = c("banana", "mango", "pear"), class = "factor"), Calories = c(100L, 100L, 200L)), class = "data.frame", row.names = c("1",

Re: [R] combining data.frames with is.na & match (), two questions

2019-04-18 Thread peter dalgaard
The whole thing is a merge operation, i.e. > FruitNutr <- read.table(text=" + Fruit Calories + 1 banana 100 + 2 pear 100 + 3 mango 200 + ") > FruitData <- read.table(text=" + Fruit Color Shape Juice + 1 apple red round 1 + 2 banana yellow oblong 0 + 3 pear green pear 0.5 + 4 orange orange round

Re: [R] combining data.frames with is.na & match (), two questions

2019-04-18 Thread Michael Dewey
Dear Drake See in-line comments On 18/04/2019 00:24, Drake Gossi wrote: Hello everyone, I'm working through this book, *Humanities Data in R* (Arnold & Tilton), and I'm just having trouble understanding this maneuver. In sum, I'm trying to combine data in two different data.frames. This