I'm going to do a Kruskal-Wallis test in R (testing whether there is a difference between dominance status in fish (five groups, measured from 1-5) and attacks by the fish) but it seems I have som problems with the factor. I import the dataset from Excel. R doesn't recognize the dominance status as a factor (returning FALSE when asked is.factor(dominance_status). When I import the dataset as a text file R doesn't recognize the first row as column names but instead writes V1 and V2 as the name of the columns.
I would be very thankful if somebody could please help me with this problem!
Attack_data
Indvid Dominance_status Attacks
<chr> <dbl> <dbl>
1 a1 3 0
2 a2 3 0
3 a3 4 0
# ... with 22 more rows
is.factor(Dominance_status)
[1] FALSE