Re: [R] strwidth to lines

2009-01-05 Thread Thomas Kaliwe
Why do you take 2.54? I think you forgot a bracket... #par(mar = c(max(strwidth(names(x)) * 2.54, 4,4,2)) # #should be par(mar = c(max(strwidth(names(x))) * 2.54, 4,4,5)) #and 5 would be a better value. But this is merely trial and error?! Regards Thomas Kaliwe Henrique Dallazuanna schrieb:

Re: [R] strwidth to lines

2009-01-05 Thread Henrique Dallazuanna
Try this: par(mar = c(max(strwidth(names(x)) * 2.54, 4,4,2)) barplot(x, las = 3) On Mon, Jan 5, 2009 at 2:15 PM, Thomas Kaliwe wrote: > 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)

[R] strwidth to lines

2009-01-05 Thread Thomas Kaliwe
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("Z","Zz","ZZZl","T","Zzhtsddfg" ) par(mfrow = c(1,2)) par(mar = c(8,4,4,2)) barplot(x, las = 3