Skip to content
Back to formatted view

Raw Message

Message-ID: <f55e7cf50911091120g3cc1cc8ai64e87b128de401f4@mail.gmail.com>
Date: 2009-11-09T19:20:16Z
From: Ista Zahn
Subject: categorization
In-Reply-To: <cf29fdc90911091106s9602ab4tc619c7fd5d494afa@mail.gmail.com>

I don't know if it's "the fastest" way, but you can get there with

as.character(factor(exData$Condition, levels=c("c20", "c10", "c9",
"c5"), labels=c("AA", "BB", "CC", "DD")))

-Ista

On Mon, Nov 9, 2009 at 2:06 PM, phoebe kong <sityeekong at gmail.com> wrote:
> Hi All,
>
> I have a dataset with a column named "Condition",
>
>
> Sample ? Condition
> 1 ? ? ? ? ? ?c20
> 2 ? ? ? ? ? ?c20
> 3 ? ? ? ? ? ?c10
> 4 ? ? ? ? ? ?c10
> 5 ? ? ? ? ? ?c9
> 6 ? ? ? ? ? ?c9
> 7 ? ? ? ? ? ?c5
> 8 ? ? ? ? ? ?c5
> 9 ? ? ? ? ? ?c20
> 10 ? ? ? ? ?c10
>
> Could you let me know the fastest way to change c20->"AA", c20->"BB",
> c9->"CC", c5->"DD" without using for loop?
>
> Thanks
> phoebe
>
> ? ? ? ?[[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>



-- 
Ista Zahn
Graduate student
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org