t = table(iris$Species)
I don't think you can really do this with the
pie function. If you look at
View(pie) you'll see that the labels are drawn using the
text function. This means that they are not really axis labels, and that
par has little effect on them. You could try to do stuff by using the arguments of the text function (i.e.
pos = 2, offset = 1) but this will affect all labels in the exact same way and results in warnings. To me it seems that the only way is the stupid way by adding some spaces before/ after labels. ie:
t = table(iris$Species) nms = rownames(t) # spaces needed after the labels nms = paste0(nms, strrep(' ', 7)) # spaces needed before the labels nms[c(1, 3)] = paste0(strrep(' ', 7), nms[c(1, 3)]) pie(t, labels = nms)
If you want to a better solution, you could rewrite the pie function to be a bit more flexible or use a different package.