[R] Width of a text

Christofer Bogaso bog@@o@chri@tofer @ending from gm@il@com
Wed Dec 12 12:55:37 CET 2018


Hi,

In HTML there is a way to measure the width of a Text before printing it on
screen as in https://www.w3schools.com/tags/canvas_measuretext.asp

In R we have nchar() function which just measures the number of letters in
a Text, but I wonder if we can measure the width of text as well.

I have a shiny app where I need to print a text in an Area onto the screen
which has a specific width, so some the texts are not showing within that
area (overflowing), where some are though all of them have the equal number
of letters.

Thanks for any input.

	[[alternative HTML version deleted]]



More information about the R-help mailing list