search for: factormap

Displaying 2 results from an estimated 2 matches for "factormap".

Did you mean: factorial
2006 Mar 17
3
Collapsing levels of a factor
> x <- factor(1:3, labels = c("b" , "f", "minus")) > x [1] b f minus Levels: b f minus I want to change all "minus" to "b". I know that the simplest way to do this is > levels(x) <- c("b", "f", "b") and also that > x[x == "minus"] <- "b" > x <- factor(x)
2006 Mar 17
3
Collapsing levels of a factor
> x <- factor(1:3, labels = c("b" , "f", "minus")) > x [1] b f minus Levels: b f minus I want to change all "minus" to "b". I know that the simplest way to do this is > levels(x) <- c("b", "f", "b") and also that > x[x == "minus"] <- "b" > x <- factor(x)