Share the Gallery !Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInEmail this to someone

#26_add_number_of_value_onto_a_boxplot

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

Be the First to Comment!

Notify of
avatar
wpDiscuz