Re: [R] unique/subset problem

From: Weiwei Shi <helprhelp_at_gmail.com>
Date: Thu 25 Jan 2007 - 18:30:26 GMT

Hi,

Even you removed "many" genomes1 by setting score< -5; it is not necessary saying you changed the uniqueness.

To check this, you can do like
p0 <- unique(dataset[dataset$score< -5, "genome1"]) # same as subset p1 <- unique(dataset[dataset$score>= -5, "genome1"])

setdiff(p1, p0)

if the output above has NULL, then it means even though you remove many genomes1, but it does not help changing the uniqueness.

HTH, weiwei

On 1/25/07, lalitha viswanath <lalithaviswanath@yahoo.com> wrote:
> Hi
> I am new to R programming and am using subset to
> extract part of a data as follows
>
> names(dataset) =
> c("genome1","genome2","dist","score");
> prunedrelatives <- subset(dataset, score < -5);
>
> However when I use unique to find the number of unique
> genomes now present in prunedrelatives I get results
> identical to calling unique(dataset$genome1) although
> subset has eliminated many genomes and records.
>
> I would greatly appreciate your input about using
> "unique" correctly in this regard.
>
> Thanks
> Lalitha
>
>
>
> ____________________________________________________________________________________
> TV dinner still cooling?
> Check out "Tonight's Picks" on Yahoo! TV.
>
> ______________________________________________

> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Weiwei Shi, Ph.D
Research Scientist
GeneGO, Inc.

"Did you always know?"
"No, I did not. But I believed..."
---Matrix III

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Fri Jan 26 05:36:21 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 26 Jan 2007 - 15:30:29 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.