I have text variable X1
. It takes value A,B,C,D
. I need to rename category D to F. So in output i expect A,B,C,F
How can i do it?
here my dataset
mydat=structure(list(x1 = structure(1:4, .Label = c("a", "b", "c",
"d"), class = "factor"), x2 = c(1L, 1L, 1L, 1L), x3 = c(2L, 2L,
2L, 2L)), .Names = c("x1", "x2", "x3"), class = "data.frame", row.names = c(NA,
-4L))