[R] From strings to numbers

From: Naira <nanao_at_psb.ugent.be>
Date: Mon, 19 May 2008 03:13:09 -0700 (PDT)

Dear all,

I would like to know if there is an easy to transform a vector of strings to a vector of integers.
Ex:
("ab","ab","bb","cat","cat","ab") will be
(1, 1, 2, 3, 3, 1)

Thx,
Naira

-- 
View this message in context: http://www.nabble.com/From-strings-to-numbers-tp17315179p17315179.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help_at_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.
Received on Mon 19 May 2008 - 12:15:07 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 19 May 2008 - 12:30:37 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.

list of date sections of archive