How to put values on boxplot and control its width?
X<-c(1,2,,3,4,4,5,5,6,6,6,6,6,7)
I need to write values for min, max, 1st quartile,
The answer provided by mnel is perfect, assuming —as in the example— that there are not outliers. In that case, the lower and upper whiskers are then equal to the minimum and maximum. But, if there are outliers and we don't specify range = 0 in the boxplot function, we don't get the right values for the labels. Instead, we could use:
text(x=boxplot.stats(X)$stats, labels = boxplot.stats(X)$stats, y = 1.25)
Let's see an example:
Horizontally
X <- c(1,2,3,3,4,4,5,5,6,6,6,6,10,15)
boxplot(X, horizontal = TRUE, axes = FALSE, staplewex = 1)
text(x = fivenum(X), labels = fivenum(X), y = 1.25) 
text(x = boxplot.stats(X)$stats, labels = boxplot.stats(X)$stats, y = 1.25)
Vertically
Switching the arguments for x and y inside text.
boxplot(X, axes = FALSE, staplewex = 1)
text(y = boxplot.stats(X)$stats, labels = boxplot.stats(X)$stats, x = 1.25)