Thank you
 Dr. Iasonas Lamprianou



Assistant Professor (Educational Research and Evaluation)
Department of Education Sciences
European University-Cyprus
P.O. Box 22006
1516 Nicosia
Cyprus 
Tel.: +357-22-713178
Fax: +357-22-590539




Honorary Research Fellow
Department of Education
The University of Manchester
Oxford Road, Manchester M13 9PL, UK
Tel. 0044  161 275 3485
[email protected]




________________________________
From: Henrique Dallazuanna <[email protected]>

Cc: [email protected]
Sent: Mon, 3 January, 2011 13:26:43
Subject: Re: [R] factor names

Try this:

f <- factor(sample(c("Engineer", "Doctor", "Teacher"), 50, rep = TRUE))
levels(f)[levels(f) %in% c('Doctor', 'Teacher')] <- 
paste(abbreviate(c('Doctor', 
'Teacher'), 5), collapse = " & ")




rote:

Dear all
>I have a factor variable which holds values like "Engineer", "Doctor", 
"Teacher"
>etc. I would like to collapse those categories so that Teachers and 
Sociologists
>form one category named "Teach & Soc" etc. However, I do not know how I can do
>it. Recoding does not seem to work.
>
>Thank you
> Dr. Iasonas Lamprianou
>
>
>
>
>Assistant Professor (Educational Research and Evaluation)
>Department of Education Sciences
>European University-Cyprus
>P.O. Box 22006
>1516 Nicosia
>Cyprus
>Tel.: +357-22-713178
>Fax: +357-22-590539
>
>
>
>
>Honorary Research Fellow
>Department of Education
>The University of Manchester
>Oxford Road, Manchester M13 9PL, UK
>Tel. 0044  161 275 3485
>[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.
>


-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O



      
        [[alternative HTML version deleted]]

______________________________________________
[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.

Reply via email to