Skip to content
Prev 166009 / 398502 Next

strwidth to lines

Dear members,

Is there a way to turn a strwidth of a string into a number of lines 
that ist needed to display the string when using par(mar = c(?,4,4,2))

####
x = 1:5
names(x) = c("ZZZZZ","ZZZZZzzzzz","ZZZlllll","TTTTT","Zzhtsddfg" )
par(mfrow = c(1,2))
par(mar = c(8,4,4,2))
barplot(x, las = 3, main = "8 is to much")
par(mar = c(4,4,4,2))
barplot(x, las = 3, main = "4 is not enough")
###


strwidth2lines...


regards

Thomas Kaliwe