We have a dataset with 1000 expression values for each of 10 subjects. We want to visualize the data distribution of each subject as a box in a boxplot.
load('exercise.RData')
head(dataset)
## Subject1 Subject2 Subject3 Subject4 Subject5 Subject6
## 1 2.585529 0.2239254 0.5638543 0.52228217 0.627965113 -1.4203239
## 2 2.709466 -1.1562233 1.3707404 0.00979376 0.002143951 -2.4669386
## 3 1.890697 0.4224185 2.2435218 -0.44052620 0.284377723 0.4847158
## 4 1.546503 -1.3247553 3.0583622 1.19948953 -1.001779086 -0.9379723
## 5 2.605887 0.1410843 2.8313488 -0.11746849 -0.617221929 3.3307333
## 6 0.182044 -0.5360480 2.1052118 0.03820979 0.828194239 -0.1629455
## Subject7 Subject8 Subject9 Subject10
## 1 -1.6366291 4.3036270 -0.8174921 -0.78486098
## 2 0.2115626 4.0208959 -0.2492659 -2.56005244
## 3 -0.4648317 1.9421215 0.4629986 0.07280078
## 4 -0.6623572 2.4420934 0.6673264 0.75024358
## 5 -0.1329536 0.6966689 0.4881699 -0.12824888
## 6 -1.3217017 1.9647796 1.0764874 -0.48786673
Furthermore, for each subject we know the outcome, gender and the batch where the respective sample was analyzed.
head(pheno)
## outcome gender batch
## 1 1 1 1
## 2 1 0 0
## 3 1 1 1
## 4 1 0 0
## 5 1 1 0
## 6 0 0 0
The exercise consists in plotting a single boxplot having one box for each subject. The boxplot must be interactive and allow the user to change the color of the boxes according to outcome, gender or batch. The following plot gives an example, colored according to outcome.
Finally, the interactive plot should be embedded in a R Markdown html page.
deadline: 11 - 05- 2017 email: vlagani@yahoo.it, vlagani@csd.uoc.gr