[R] How am i able to create Box plots of a factor (weight) separated by other factors (breed)?
Rich Shepard
rshepard at appl-ecosys.com
Sun Mar 15 13:55:10 CET 2015
On Sun, 15 Mar 2015, Lyle Warren wrote:
>> I have data with columns for animal ID, breed, and weight.
>> I'd like to create a box plot of weight, separated by breed (there are 4
>> breeds).
>> Any ideas?
1. Did you check the help page: ?boxplot
>> Here's a sample of the data (there are 100 rows):
>>
>> id weight breed
>> 1 453 brahman
>> 2 527 brahman
>> 3 520 brahman
>> 4 460 brahman
>> 5 496 brahman
>> 6 461 brahman
>> 7 519 brahman
>> 8 472 brahman
>> 9 531 brahman
>> 10 473 brahman
>> 11 509 brahman
>> 12 503 brahman
B. Perhaps something like this?
boxplot(weight ~ breed)
Look at the use of a formula when plotting.
If I misread your intent I apologize.
HTH,
Rich
More information about the R-help
mailing list