Learn R Programming

matRiks (version 0.1.3)

draw: Draw (Method)

Description

Draws single figures, matrices with 9 or 4 cells, or response list of a matriks

Usage

draw(
  obj,
  main = NULL,
  canvas = TRUE,
  hide = FALSE,
  bg = "white",
  mar = c(1, 1, 1, 1),
  xlim = 16,
  ...
)

# S3 method for figure draw( obj, main = NULL, canvas = TRUE, hide = FALSE, bg = "white", mar = c(1, 1, 1, 1), xlim = 16, ... )

# S3 method for matriks draw( obj, main = NULL, canvas = TRUE, hide = FALSE, bg = "white", mar = c(1, 1, 1, 1), xlim = 16, ... )

# S3 method for responses draw( obj, main = NULL, canvas = TRUE, hide = FALSE, bg = "white", mar = c(1, 1, 1, 1), xlim = 16, distractors = NULL, print = FALSE, ... )

Value

A graphic

A graphic of the figure

A graphic of the matriks

A graphic of the matriks

Arguments

obj

The figure/matriks/response list to be drawn

main

logical, print the title of the drawing. Default is FALSE

canvas

logical, draw the figure on a new canvas. Default is TRUE

hide

logical, hide the cell corresponding to the correct response. Default is FALSE

bg

character, define the color background. Default is white

mar

numeric vector, change margins of the canvas

xlim

numeric, change the length of the x axis

...

other arguments

distractors

character, names of the distractors to be printed

print

logical, print all the distractors together (default, FALSE) or one by one (TRUE)

Methods (by class)

  • draw(figure): Draw figure

    Draw a figure

  • draw(matriks): Draw Matriks

    Draw a matriks

  • draw(responses): Draw response list

    Draw the response list of a matriks

Examples

Run this code
# draw a circle
draw(circle())
# draw a circle inside the first circle
draw(size(circle(), 2), canvas = FALSE)
# draw a circle
draw.figure(circle())

# draw a circle inside the other
draw.figure(size(circle(), 2), canvas = FALSE)
# draw a matriks
my_mat <- mat_apply(cof(circle(), luck(), pacman()), "shade", "shape")
draw(my_mat)
# generate a matriks
my_mat1 <- mat_apply(cof(s_axe(), luck(), pacman()), "rotate", "shape")
my_mat2 <- mat_apply(dot(), "shade", "shade")
my_mat <- com(my_mat1, my_mat2)
# generate a response list
my_resp <- response_list(my_mat)
# draw response list
draw(my_resp)

Run the code above in your browser using DataLab