[R] deleting the first two characters in each row of a factorized column

Ivan Calandra ivan.calandra at uni-hamburg.de
Mon Mar 28 16:51:05 CEST 2011


Hi,

I'm not sure it's the best solution, but I think this should do:
levels(small_factor) <- gsub("d_", "", levels(small_factor))
small_factor
[1] variable1 variable2 variable3
Levels: variable1 variable2 variable3

HTH,
Ivan

Le 3/28/2011 16:40, Bodnar Laszlo EB_HU a écrit :
> small_factor<- factor(c("d_variable1","d_variable2","d_variable3"))

-- 
Ivan CALANDRA
PhD Student
University of Hamburg
Biozentrum Grindel und Zoologisches Museum
Abt. Säugetiere
Martin-Luther-King-Platz 3
D-20146 Hamburg, GERMANY
+49(0)40 42838 6231
ivan.calandra at uni-hamburg.de

**********
http://www.for771.uni-bonn.de
http://webapp5.rrz.uni-hamburg.de/mammals/eng/1525_8_1.php



More information about the R-help mailing list