Re: [R] Replacing text

From: Henrique Dallazuanna <wwwhsd_at_gmail.com>
Date: Tue, 11 Mar 2008 15:58:05 -0300

If the column is factor:

levels(DATA$x)[levels(DATA$x) == "Toyota2"] <- "Scion"

or character:

DATA$x[DATA$x == "Toyota2"] <- "Scion"

On 11/03/2008, Suran, Luciana @ Torto Wheaton Research <Luciana.Suran_at_tortowheatonresearch.com> wrote:
> Sorry, another newbie question :-(
>
>
>
>
>
> I loaded a data set with 10 rows and 30 columns. The first column is
> characters for names of car manufacturers:
>
>
>
> Jeep
>
> Nissan
>
> Toyota1
>
> Toyota2
>
> Etc.
>
>
>
> How can I replace "Toyota2" with "Scion"?
>
>
>
> Thanks again
>
>
>
>
>
>
>
>
>
>
> [[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.
>

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

______________________________________________
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 Tue 11 Mar 2008 - 19:05:35 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 Tue 11 Mar 2008 - 19:30:25 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.

list of date sections of archive