I know that many have asked the exact same thing, but nothing solved it for me...
I want to compare the size of a morphological structure between two age groups (which I call BW and brownish), I'm sure I only have these two categories and there are no empty cells or NAs
But every time I try it appears that I have more than 2 levels
I can't use the levels function either, it returns null, str(dd1) returns male_color is a Character Datatype and the Right_tarsus is a number Datatype data, as the spected
the morphological data also worked well in the ggdensity and shapiro.test to test normality,
MU_test_color_tarsus <- wilcox.test(Right_tarsus ~ male_color, data = dd1, paired = F, conf.level = 0.95)
wilcox.test(Right_tarsus ~ male_color, data = dd1, paired = F, conf.level = 0.95)
table(dd1$Right_tarsus)
andtable(dd1$male_color)
look like? It may be that there are some misspelled values in your data. – dcarlsonmale_color
is of type character then it has no levels - it needs to be of type factor. Perhaps trydd1$male_color <- as.factor(dd1$male_color)
then run the test again ? But really we need to see your data by including a small representative dataset in a plain text format - for example the output fromdput(dd1)
, if that is not too large. – neilfws