Lalitha Viswanath wrote:
> I have a data frame with 40,000 rows and 4 columns,
> one of which is "class".
>
> For each row, the "class" column can be one of 10 possible NUMERIC
> values. I wish to substitute these numeric values with
> words/characters. For example, I wish to substitute all occurences
> of "5467" in the column "class" with "alpha", "7867" with "gamma",
> etc. I looked up substitute, but did not find any relevant
> examples.
The substitute() function has nothing whatever to do with your
problem.
The following may give you the right idea:
> xxx <- sample(1:10,100,TRUE)
> yyy <- letters[1:10][match(xxx,1:10)]
cheers,
Rolf Turner
[EMAIL PROTECTED]
______________________________________________
[email protected] 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.