Dear Gabor Grothendieck 
Thanks a lot for the help.

M. Azam


________________________________
From: Gabor Grothendieck <ggrothendieck@gmail.com>

Cc: R-help request <r-help-request@r-project.org>; R Help <r-help@r-project.org>
Sent: Monday, December 1, 2008 12:46:06 PM
Subject: Re: [R] request: how to assign alphabets to integer values

Try:

transform(iris, Species = factor(Species, labels = letters[1:3]))


> Dear R community
> I am trying to assign alphabets to integer values 1, 2, 3 etc. in y given below. Can any body suggest some simple way to do the same job?
>
> ds=iris; dl=nrow(ds)
> c1=ds[,1]; c2=ds[,2]; c3=ds[,3]; c4=ds[,4]; c5=ds[,5]; iris=cbind(c1,c2,c3,c4,c5)
> y=iris[,5]
> y1=which(y==1); y[y1] <- c("a"); y2=which(y==2); y[y2] <- c("b"); y3=which(y==3); y[y3] <- c("c");
> iris=cbind(c1,c2,c3,c4,y)
>
> Thnks and best regards
> M. Azam
>
>
>
>        [[alternative HTML version deleted]]
>
>
> ______________________________________________
> 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.
>
>



      
	[[alternative HTML version deleted]]

