I am trying to produce a map using the tmap library. I want to label all areas and use lead lines to label tiny areas. I'm looking for a line of code that works like ggrepel in ggplot2 or geom_sf_label_repel in the sf library but for tmap.
Here is a sample code which shows all labels but no lead lines outside the polygons:
library(tmap)
data(World)
tm_shape(World) + tm_polygons("HPI") + tm_text("name",size=0.4)
THis is the result:
There are overlapping labels that could have been placed in the white spaces with leading lines to the polygons
This is the kind of end result I hope to have where the polygon is too small to show a label correctly:
How do I achieve this with tmap with an actual shapefile?

