Boxplot is an R function that represents a numeric vector of data that is split in several groups.

It can be usefull to specify a feature for each group. In this exemple, the number of vlues within each group is represented. Another utility could be to add the significance of a statistical test.

The trick is to use the text function, that permits to add text wherever in a R plot. For this function, you have to give

– a vector with the x-axis positions of the labels you want to add. In our case, it will be 1,2,3…until the number of groups you have.

-a vector with the y axis positions. In our case, we have to take the maximum of the value of each plot. These values are given in the $stats attribute of your boxplot.

-a vector with the labels : the number of value per group or whatsoever.




Not much what you are looking for ?



Leave a Reply

Notify of