Re: [R] request: how to assign alphabets to integer values

2008-12-01 Thread Muhammad Azam
Dear Gabor Grothendieck Thanks a lot for the help. M. Azam From: Gabor Grothendieck <[EMAIL PROTECTED]> Cc: R-help request <[EMAIL PROTECTED]>; R Help Sent: Monday, December 1, 2008 12:46:06 PM Subject: Re: [R] request: how to assign alphabet

Re: [R] request: how to assign alphabets to integer values

2008-12-01 Thread Gabor Grothendieck
Try: transform(iris, Species = factor(Species, labels = letters[1:3])) On Mon, Dec 1, 2008 at 4:35 AM, Muhammad Azam <[EMAIL PROTECTED]> wrote: > 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 s

[R] request: how to assign alphabets to integer values

2008-12-01 Thread Muhammad Azam
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(