Thanks a lot for the help.
-Adrian
On Sun, Nov 4, 2012 at 2:39 PM, jim holtman wrote:
> Is this what you want:
>
>> mdf <- read.table(text = " id samp1 samp2 samp2a
> + 1 A 100 110110
> + 2 A 120 130150
> + 3 C 101 131151
> + 4 D 110 150130
> + 5 E 132 12
To: r-help
Cc:
Sent: Sunday, November 4, 2012 2:25 PM
Subject: [R] select duplicate identifier with higher mean across sample columns
Hi Group:
I searched R groups before posting this question. I could not find the
appropriate answer and I do not have clear understanding how to do
this in R.
I
Hello,
Thanks for the data example. (You forgot samp2a).
Try the following.
mdf <- read.table(text="
id samp1 samp2 samp2a
1 A 100 110110
2 A 120 130150
3 C 101 131151
4 D 110 150130
5 E 132 122122
6 F 123 143143
", header=TRUE)
idx <- ave(
Is this what you want:
> mdf <- read.table(text = " id samp1 samp2 samp2a
+ 1 A 100 110110
+ 2 A 120 130150
+ 3 C 101 131151
+ 4 D 110 150130
+ 5 E 132 122122
+ 6 F 123 143143", header = TRUE)
> result <- do.call(rbind, lapply(split(mdf, mdf$i
Hi Group:
I searched R groups before posting this question. I could not find the
appropriate answer and I do not have clear understanding how to do
this in R.
I have a data frame with duplicated row identifiers but with different
values across columns. I want to select the identifier with higher
i
5 matches
Mail list logo