[R] grid: dividing units by numbers

Wolfram Fischer wolfram at fischer-zim.ch
Wed Oct 29 16:36:03 CET 2003


How can I divide a unit by an number
or average a vector of units, e.g.:

	u1 <- unit( 3, 'npc' )
	u2 <- unit( 6, 'npc' )

	u1 / 2
	( u1 + u2 ) / 2
	mean( unit.c(u1,u2) )

I would use that e.g. to to calculate the coordinates
of the midpoint of a line.

Wolfram




More information about the R-help mailing list