I have clinical data with:
Type, Age, Sex
One, 24, M
Two, 45, F
One, 48, M
.
.
.
I would like to use R to show some useful plots, for example a box plot.
I would like to have Type
on the x-axis and Age
on the y-axis with vertical boxes, but also split by Sex
, so separate for male and female but grouped by Type
.
My first try is:
DATA_SET <- read.csv("myfile.csv")
x <- DATA_SET[,'Type']
y <- DATA_SET[,'Age']
plot(x,y)
It's quite okay but I would like to add titles to each axis and have more values (be more acurate for readers) on the y-axis. And most importantly, split each box into two--separate for male and female.