turtle_do: Evaluate a Larger Portion of Turtle Drawing Code

Description Usage Arguments Details See Also Examples

Description

turtle_do evaluates an R expression with the Turtle temporarily hidden (for performance reasons).

Usage

1
turtle_do(expr)

Arguments

expr

expression to evaluate

Details

The terrarium must be initialized prior to using these functions, see turtle_init.

In order to decrease the evaluation time of expr, it is evaluated with Turtle temporarily hidden. Basically it means that if a Turtle image is visible (see turtle_show and turtle_hide) turtle_do removes it, evaluates expr and redraws it on the function exit.

See Also

Other TurtleGraphics: TurtleGraphics-package, turtle_getpos, turtle_goto, turtle_init, turtle_move, turtle_param, turtle_reset, turtle_show, turtle_status, turtle_turn, turtle_up

Examples

1
2
3
4
5
6
7
turtle_init()
turtle_do({
   for (i in 1:4) {
      turtle_forward(50)
      turtle_right(90)
   }
})

TurtleGraphics documentation built on May 2, 2019, 1:07 p.m.