TurtleGraphics - Online Manual

turtle_init {TurtleGraphics}R Documentation

Set Up a New, Shiny Terrarium

Description

This function creates a new empty plot with the Turtle centered on the board and facing to the north.

Usage

turtle_init(width = 100, height = 100, mode = c("error", "clip", "cycle"))

Arguments

width

numeric; plot width.

height

numeric; plot height.

mode

character string; one of "error", "clip", or "cycle".

Details

The mode argument determines what happens if the Turtle tries to move outside the terrarium. clip allows it to do that, but the drawing will be clipped to the predefined plot region. error throws an error. cycle makes the Turtle appear on the other side of the board.

After the turtle_init() function has been called you can e.g. move the Turtle with the turtle_forward function, turn its direction with turtle_right or set display parameters of the Turtle's trace, see turtle_param.

See Also

Other TurtleGraphics: TurtleGraphics-package; turtle_backward, turtle_forward, turtle_move; turtle_col, turtle_lty, turtle_lwd, turtle_param; turtle_down, turtle_up; turtle_do; turtle_getangle, turtle_getpos; turtle_goto, turtle_setangle, turtle_setpos; turtle_hide, turtle_show; turtle_left, turtle_right, turtle_turn; turtle_reset; turtle_status


[Package TurtleGraphics version 1.0-5 Index]