search for: pf_mcl

Displaying 8 results from an estimated 8 matches for "pf_mcl".

2017 Oct 14
2
Populate one data frame with values from another dataframe for rows that match
...works perfectly. On 13/10/2017, 23:35, "Rui Barradas" <ruipbarradas at sapo.pt> wrote: 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 populate the column ?pf_mcl? in myDF1 with values from myDF2, where rows match based on column &quot...
2017 Oct 14
0
Populate one data frame with values from another dataframe for rows that match
...hich 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 to modify your sample data. Specifically, I changed some studyno settings in myDF1, and also the entries of pf_mcl in myDF1. myDF1 <- structure(list(studyno = c("J1000/8", "J1000/9", "J1000/9", "J1000/9", "J1000/5", "J1000/6"), date = structure(c(17123, 17127, 17135, 17144, 17148, 17155), class = "Date"), pf_mcl = c(1:6 ), year = c(2016,...
2017 Oct 15
1
Populate one data frame with values from another dataframe for rows that match
Dear @William<mailto:wdunlap at tibco.com>, thanks for the feedback. I have tested it on the larger dataset and noticed that it created two variables, pf_raw and pf_curated. The output we were looking for, was one that takes the variable pf_mcl in curated dataset and replaces pf_mcl in matching rows within the raw dataset. @Eric<mailto:ericjberger at gmail.com>?s solution was able to achieve that. Nonetheless, we do appreciate your solution. Regards ------------------ Kevin Wamae From: William Dunlap <wdunlap at tibco.com>...
2017 Oct 13
4
Populate one data frame with values from another dataframe for rows that match
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", "J1000/9",...
2017 Oct 14
2
Populate one data frame with values from another dataframe for rows that match
...ject.org> Subject: Re: [R] Populate one data frame with values from another dataframe for rows that match ?merge Bert On Oct 13, 2017 12:09 PM, "Kevin Wamae" <KWamae at kemri-wellcome.org<mailto:KWamae at kemri-wellcome.org>> 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 the data.frames. myDF1 <- structure(list(studyno = c("J1000/9", "J1000/9",...
2017 Oct 14
0
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 problem. In any case, let's redefine myDF1 and myDF2. Note that myDF1 contains a studyno not in myDF2 and vice versa. myDF1 <- structure(list(studyno = c("J1000/9", "J895/7...
2017 Oct 13
0
Populate one data frame with values from another dataframe for rows that match
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 populate the column ?pf_mcl? in myDF1 with values from myDF2, where rows match based on column "studyno" but the solutions I have...
2017 Oct 13
0
Populate one data frame with values from another dataframe for rows that match
?merge Bert On Oct 13, 2017 12:09 PM, "Kevin Wamae" <KWamae at kemri-wellcome.org> 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 the data.frames. > > myDF1 <- structure(list(studyno = c("J1000/9&...