[R] Odp: Conflating categories

From: Petr PIKAL <petr.pikal_at_precheza.cz>
Date: Fri, 14 Dec 2007 14:54:06 +0100


Hi

r-help-bounces_at_r-project.org napsal dne 14.12.2007 13:39:02:

>
>
> Hi,
>
> I think this is a pretty basic question. I still couldn#t find the
answer to
> it, though.
>
> I have some data loaded into R, which looks like this:
>
> > data()
> ...
> 38358 Advice Article
> 38359 Advice Article
> 38360 GeneralInfo List
> 38361 GeneralInfo Article
> 38362 Purchase Paragraphs
> 38363 Purchase List
> 38364 Purchase Paragraphs
> ...

If it is factor you can change its levels

> temp$V1

[1] A01 A01 A01 A02 A02 A03 A03 A04
Levels: A01 A02 A03 A04
> levels(temp$V1)

[1] "A01" "A02" "A03" "A04"
> levels(temp$V1)[1:2]<-"one"
> temp$V1

[1] one one one one one A03 A03 A04
Levels: one A03 A04

Regards
Petr

>
>
> I now would like to edit the data in such a way that every "Advice" is
> changed into "GeneralInfo".
> Is there some easy way how I can do this?
>
> Thanks a lot!
>
> ______________________________________________
> 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.



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. Received on Fri 14 Dec 2007 - 14:09:40 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 14 Dec 2007 - 14:30:19 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.