Skip to content
Prev 166681 / 398502 Next

connecting boxplots

You do not provide a workable example and it appears you may be  
conflating the German and English spellings of "group", but perhaps  
this code fragment using the first example in boxplots help menu will  
move you along. It results in drawing the connecting lines to the  
minimum value in each group.

 > boxplot(count ~ spray, data = InsectSprays, col = "lightgray")   
#draws the plot
 > str(boxplot(count ~ spray, data = InsectSprays, col = "lightgray")  )
List of 6
  $ stats: num [1:5, 1:6] 7 11 14 18.5 23 7 12 16.5 18 21 ...

# Notice that the "stats" element is a matrix that has the first row  
as the minimums, third as the medians, and maxs are fifth.

  $ n    : num [1:6] 12 12 12 12 12 12
  $ conf : num [1:2, 1:6] 10.579 17.421 13.763 19.237 0.588 ...
  $ out  : num [1:2] 7 12
  $ group: num [1:2] 3 4
  $ names: chr [1:6] "A" "B" "C" "D" ...

 > boxplot(count ~ spray, data = InsectSprays, col = "lightgray") 
$stats[c(1,5),]
      [,1] [,2] [,3] [,4] [,5] [,6]
[1,]    7    7    0    2    1    9  # minimums
[2,]   23   21    4    6    6   26  # maximumns

 > lines(boxplot(count ~ spray, data = InsectSprays, col = "lightgray") 
$stats[c(1),]  )  #adds the lines through minimums