illiam Dunlap
Date: Saturday, 14 October 2017 at 20:21
To: Kevin Wamae
Cc: Bert Gunter , Rui Barradas ,
R-help
Subject: Re: [R] Populate one data frame with values from another dataframe for
rows that match
Your example used one distinct studyno in DF1 and one distinct pf_mcl in DF2.
I thin
Rui Barradas ,
R-help
Subject: Re: [R] Populate one data frame with values from another dataframe for
rows that match
Your example used one distinct studyno in DF1 and one distinct pf_mcl in DF2.
I think that makes it hard to see what is going on, but maybe I completely
misunderstand the prob
e way you want. ifelse() may be useful for that.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Fri, Oct 13, 2017 at 10:48 PM, Kevin Wamae
wrote:
> Dear @Bert Gunter<mailto:bgunter.4...@gmail.com>, I tried merge and I
> faced many challenges. @Rui Barradas<mailto:ruipbarra...@sapo.pt
, 14 October 2017 at 12:43
To: Kevin Wamae
Cc: Rui Barradas , "r-help@r-project.org"
Subject: Re: [R] Populate one data frame with values from another dataframe for
rows that match
Hi Kevin,
I think there are issues with Rui's proposed solution. For example, if there
are rows in
Hi Kevin,
I think there are issues with Rui's proposed solution. For example, if
there are rows in myDF1 which have a studyno
which does not match any row in myDF2, then you will lose those rows. In
your original request you said that you wanted to keep those rows.
To demonstrate my point I need t
Dear @Rui Barradas, thank you for the solution. It works perfectly.
On 13/10/2017, 23:35, "Rui Barradas" wrote:
Hello,
Try the following.
myDF1$studyno <- as.character(myDF1$studyno)
myDF2$studyno <- as.character(myDF2$studyno)
i1 <- which(names(myDF1) == "pf_
Dear @Bert Gunter<mailto:bgunter.4...@gmail.com>, I tried merge and I faced
many challenges. @Rui Barradas<mailto:ruipbarra...@sapo.pt> solution is working.
From: Bert Gunter
Date: Friday, 13 October 2017 at 22:44
To: Kevin Wamae
Cc: R-help
Subject: Re: [R] Populate one data frame
Hello,
Try the following.
myDF1$studyno <- as.character(myDF1$studyno)
myDF2$studyno <- as.character(myDF2$studyno)
i1 <- which(names(myDF1) == "pf_mcl")
merge(myDF1[-i1], myDF2, by = "studyno")
Hope this helps,
Rui Barradas
Em 13-10-2017 20:09, Kevin Wamae escreveu:
I'm trying to populat
?merge
Bert
On Oct 13, 2017 12:09 PM, "Kevin Wamae" wrote:
> I'm trying to populate the column “pf_mcl” in myDF1 with values from
> myDF2, where rows match based on column "studyno" but the solutions I have
> found so far don't seem to be giving me the desired output.
>
> Below is a snapshot of
I'm trying to populate the column “pf_mcl” in myDF1 with values from myDF2,
where rows match based on column "studyno" but the solutions I have found so
far don't seem to be giving me the desired output.
Below is a snapshot of the data.frames.
myDF1 <- structure(list(studyno = c("J1000/9", "J10
10 matches
Mail list logo