Description Usage Arguments Details See Also
This function creates a new empty plot with the Turtle centered on the board and facing to the north.
1 | turtle_init(width = 100, height = 100, mode = c("error", "clip", "cycle"))
|
width |
numeric; plot width. |
height |
numeric; plot height. |
mode |
character string; one of |
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
.
Other TurtleGraphics: TurtleGraphics-package
,
turtle_do
, turtle_getpos
,
turtle_goto
, turtle_move
,
turtle_param
, turtle_reset
,
turtle_show
, turtle_status
,
turtle_turn
, turtle_up
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.