Yes, but the elephant in the room is:

Define: "Identical."

If you do not know why this is an elephant, see FAQ 7.31.

-- Bert

On Thu, Mar 28, 2013 at 8:40 AM, Charles Berry <ccberry@ucsd.edu> wrote:

> Katherine Gobin <katherine_gobin <at> yahoo.com> writes:
>
> >
> > Dear R forum
> >
> > Suppose I have a data.frame
> >
>
> Say.
>
> [snip]
>
> > How to automatically identify and retain only one column (in this example
> column x) among the identical
> > columns besides other non-identical columns (viz. id, y and z).
>
>
> See
>
> ?unique
>
> Details
>
> This is a generic function with methods for vectors, *data frames* and ...
>
> [emphasis added]
>
> So,
>
>    unique( df, MARGIN=2 )
>
> is what you want.
>
> HTH,
>
> ______________________________________________
> R-help@r-project.org 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.
>



-- 

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm

	[[alternative HTML version deleted]]

