I'm currently trying to relevel the following data frame for presentation purposes:
Report Visual Audio Prob
Two Flashes one MF-C 300 0.43775758
Two Flashes one MF-C 3500 0.46551515
Two Flashes one SW-C 300 0.18870707
Two Flashes one Sw-C 3500 0.31036364
Two Flashes one SW-MF 300 0.18165657
Two Flashes one SW-MF 3500 0.23765657
Two Flashes one SW-ST 300 0.17452525
Two Flashes one SW-ST 3500 0.32036364
Two Flashes one SW 300 0.06117172
Here is the code I'm using to relevel:
Prob.Illusion.Total.Mean$Audio = Relevel(Prob.Illusion.Total.Mean$Audio, ref = c("SW 300", "SW-ST 300", "SW-ST 3500", "SW-MF 300", "SW-MF 3500", "MF-C 300", "MF-C 3500", "MF-C 300", "MF-C 3500"))
However, R does relevel successfully but doesn't seem to like this code and gives me these warnings:
Warning messages: 1: In
levels<-
(*tmp*
, value = if (nl == nL) as.character(labels) else paste0(labels, : duplicated levels will not be allowed in factors anymore 2: Inlevels<-
(*tmp*
, value = if (nl == nL) as.character(labels) else paste0(labels, : duplicated levels will not be allowed in factors anymore
Any ideas what is going on?
Thanks.
?relevel
? if so youre not using it correctly. if you replaceRelevel
withfactor
andref
withlevels
, then it would probably work – rawrrelevel
only change the reference level: From the man page: the levels of a factor are re-ordered so that the level specified by ref is first and the others are moved down – xraynaud