Displaying 1 result from an estimated 1 matches for "oxxxx".
Did you mean:
xxxx
How to calculate the number of times a given string can be displayed in the width of a grid viewport
2011 Aug 03
0
How to calculate the number of times a given string can be displayed in the width of a grid viewport
...ile loop where the string would be modified
by appending the original string to itseft until its width is larger
than the width of the viewport), this solution seems a bit overworked.
Any suggestion would be welcome.
Sebastien
require(grid)
dev.off()
dev.new()
nstr <- ''
str <- 'OXXXX'
nInWidth <- floor(unit(1,'npc')/unit(1,'strwidth',str)) # Does not work
nInWidth <- 0
convertWidth(unit(1,'strwidth',nstr),'npc')
while
(unclass(convertWidth(unit(1,'strwidth',paste(nstr,str,sep='')),'npc'))[1]
- 1 <=.Machin...