I am new to R and doing some basic things. I wonder how can I find mean for only some rows. For example, how can I find mean weight for korgi only? (There are actually 100 rows instead of 8 and rows 1-50 are korgi) I tried korgiweight <-aggregate(mytabledata[1:50], list(mytabledata$Weight(kg), mean)
But it says 'undefined columns selected' Thanks.
**Breed Weight(kg)**
Korgi 10
korgi 11
korgi 10.5
korgi 12
husky 20
husky 24
husky 26
husky 25