Learn R Programming

matRiks (version 0.1.3)

shape: Shape rule (Method)

Description

Apply a change in figures rule by change the visibility of the shapes in a figure

Usage

shape(fig, n, rule, ...)

# S3 method for figure shape(fig, n = 1, rule = "shape", ...)

Value

An object of class figures, only the first figure is visible

Arguments

fig

A vector of figures obtained with the concatenation of figures function (cof()). Three figures are needed

n

integer, the index of the element to see. Default is 1 (the first figure in cof() is shown). To see the other figures, change n to index the figure you want to show

rule

character, defines the rule for shading the figure

...

Other arguments

Methods (by class)

  • shape(figure): Change the visible shapes

Examples

Run this code
# Three figures, only the first is shown
draw(shape(cof(s_lily(), square(), s_star())))

# Show the third figure (star)
draw(shape(cof(s_lily(), square(), s_star()), n = 3))

# Show the first and the second figures
 draw(shape(cof(s_lily(), square(), s_star()), n = c(1,2)))

Run the code above in your browser using DataLab