turtle_do: Evaluate a Larger Portion of Turtle Drawing Code

View source: R/do.R

turtle_doR Documentation

Evaluate a Larger Portion of Turtle Drawing Code

Description

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

Usage

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

turtle_init()
turtle_do({
   for (i in 1:4) {
      turtle_forward(50)
      turtle_right(90)
   }
})


Rexamine/TurtleGraphics documentation built on Aug. 9, 2022, 9:25 a.m.