[R] extract arguments from a list

2006-10-19 Thread jessica . gervais
Hi,

I would like to know how to extract the arguments from a list :

For example, I have a list of charchacter x
x- 
c(Bentazone,Atrazine,Epoxiconazol,Metolachlor,Epoxiconazol,Atrazine 
desethyl,Fenpropimorph,Epoxiconazol,Metolachlor,Simazine,Atrazine 
desethyl,Epoxiconazol,Atrazine 
desethyl,Atrazine,Epoxiconazol,Metolachlor,Epoxiconazol,Atrazine 
desethyl,Fenpropimorph,Epoxiconazol,Metolachlor,Simazine)
 
and I am searching for a (basic) function which would return arguments of 
the list x, aphabeticaly reordered like this :
 (Atrazine,Atrazine 
desethyl,Bentazone,Epoxiconazol,Fenpropimorph,Metolachlor,Simazine).


Can anyone help me ?


Thanks by advance

Jessica



 
[[alternative HTML version deleted]]

__
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.


Re: [R] extract arguments from a list

2006-10-19 Thread David Barron
First, that isn't what is called a list in R, it is a character vector.

Second, to get what you want, try

 sort(unique(x))
[1] Atrazine  Atrazine desethyl Bentazone
[4] Epoxiconazol  Fenpropimorph Metolachlor
[7] Simazine

On 19/10/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Hi,

 I would like to know how to extract the arguments from a list :

 For example, I have a list of charchacter x
 x-
 c(Bentazone,Atrazine,Epoxiconazol,Metolachlor,Epoxiconazol,Atrazine
 desethyl,Fenpropimorph,Epoxiconazol,Metolachlor,Simazine,Atrazine
 desethyl,Epoxiconazol,Atrazine
 desethyl,Atrazine,Epoxiconazol,Metolachlor,Epoxiconazol,Atrazine
 desethyl,Fenpropimorph,Epoxiconazol,Metolachlor,Simazine)

 and I am searching for a (basic) function which would return arguments of
 the list x, aphabeticaly reordered like this :
  (Atrazine,Atrazine
 desethyl,Bentazone,Epoxiconazol,Fenpropimorph,Metolachlor,Simazine).


 Can anyone help me ?


 Thanks by advance

 Jessica




 [[alternative HTML version deleted]]

 __
 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.



-- 
=
David Barron
Said Business School
University of Oxford
Park End Street
Oxford OX1 1HP

__
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.