Displaying 1 result from an estimated 1 matches for "fishdatamean".
Did you mean:
fishdatameans
2007 Sep 07
1
aggregate factor
...1 1 1 1 1 1 1 1 1 1 ...
$ TL : int 132 120 125 115 130 120 115 110 117 116 ...
$ W : int 10 10 10 10 10 10 10 10 10 20 ...
$ Sex : Factor w/ 3 levels "F","I","M": 1 1 2 2 2 1 1 1 2 2 ...
$ WT : num 0.23 0.23 0.23 0.23 0.23 0.23 0.23 0.23 0.23 0.23 ...
> fishdatameans=aggregate(fishdata$TL, list(Lake = fishdata$Lake,
Age=fishdata$Age), mean)
# Now Age is a Factor but 10 is in the wrong position.
> fishdatameans$Age
[1] 0 1 1 1 2 2 2 3 3 3 4 4 4 5 5 6 6 6 7 8 9 10
Levels: 0 1 10 2 3 4 5 6 7 8 9
> as.numeric(fishdatameans$Age)
[...