Learn R Programming

matRiks (version 0.1.3)

cof: Concatenation of figures (method)

Description

Concatenation of different figures to create a new figure

Usage

cof(..., name, single)

# S3 method for figure cof(..., name = NULL, single = FALSE)

# S3 method for character cof(...)

com(...)

# S3 method for matriks com(...)

concatenation(...)

# S3 method for list concatenation(...)

# S3 method for double concatenation(...)

# S3 method for double cof(...)

# S3 method for numeric cof(...)

# S3 method for character concatenation(...)

# S3 method for integer concatenation(...)

Value

An object of class figure

An object of class figure

A concatenation of character

An object of class matriks resulting from the hierarchical concatenation of the original matrices

An object of class matriks resulting from the hierarchical concatenation of the original matrices

Arguments

...

The to be concatenated

name

character, name of the figure created with cof()

single

logical, force the figure to be a single figure to be used in shape(). Default is FALSE

Methods (by class)

  • cof(figure): Concatenation of figures (figures)

    Concatenation of different figures to create a new figure

  • cof(character): Concatenation of character

    Concatenation of different figures to create a new figure

  • cof(double): Concatenation of double

  • cof(numeric): Concatenation of numeric

Functions

  • com(): Concatenation of matrices (Method)

    Hierarchical concatenation of 2+ matrices on top of one another. The first matrix is placed on the bottom, the last matrix is placed on top of all other matrices.

  • com(matriks): Concatenation of matrices

    Hierarchical concatenation of 2+ matrices on top of one another. The first matrix is placed on the bottom, the last matrix is placed on top of all other matrices.

  • concatenation(): Concatenation (Method)

  • concatenation(list): Concatenation of lists

  • concatenation(double): Concatenation of double

  • concatenation(character): Concatenation of characters

  • concatenation(integer): Concatenation of stuff

Examples

Run this code

# concatenate figures without creating a new figure
new_figure <- cof(square(), size(malta(), 2))
# structure of new_figure
str(new_figure)
# concatenate figures and create a new figure
my_figure <- cof(square(), size(malta(), 2),
                  single = TRUE,
                   name = "my_figure")
# structure of new_figure
 str(my_figure)
# concatenate figures without creating a new figure
new_figure <- cof(square(), size(malta(), 2))
# structure of new_figure
str(new_figure)
# concatenate figures and create a new figure
my_figure <- cof(square(), size(malta(), 2),
                  single = TRUE,
                   name = "my_figure")
# structure of new_figure
 str(my_figure)
# concatenate figures without creating a new figure
new_figure <- cof(square(), size(malta(), 2))
# structure of new_figure
str(new_figure)
# concatenate figures and create a new figure
my_figure <- cof(square(), size(malta(), 2),
                  single = TRUE,
                   name = "my_figure")
# structure of new_figure
 str(my_figure)
# create the first layer matrix
m1 <- mat_apply(hexagon(), hrules = "lty")
# create the second matrix
m2 <- mat_apply(size(malta(), 2), vrules = "shade")
# concatenate the matrices
the_mat <- com(m1, m2)
# draw the final matrix
draw(the_mat)
# create the first layer matrix
m1 <- mat_apply(hexagon(), hrules = "lty")
# create the second matrix
m2 <- mat_apply(size(malta(), 2), vrules = "shade")
# concatenate the matrices
the_mat <- com(m1, m2)
# draw the final matrix
draw(the_mat)
# concatenate two characters
concatenation("a", "b")
# create some lists
a <- list(letters[c(14,13)], LETTERS[c(4, 3)])
b <- list(letters[c(12, 13)], LETTERS[c(4, 3)])
concatenation(a, b)
# create the first layer matrix
m1 <- mat_apply(hexagon(), hrules = "lty")
# create the second matrix
m2 <- mat_apply(size(malta(), 2), vrules = "shade")
# concatenate the matrices
the_mat <- com(m1, m2)
# draw the final matrix
draw(the_mat)
# create the first layer matrix
m1 <- mat_apply(hexagon(), hrules = "lty")
# create the second matrix
m2 <- mat_apply(size(malta(), 2), vrules = "shade")
# concatenate the matrices
the_mat <- com(m1, m2)
# draw the final matrix
draw(the_mat)
# concatenate two numeric
cof(rnorm(1, 25), rnorm(4, 34))
# concatenate two numeric
cof("a", "b", "d")
# concatenate two numeric
cof(1:3, 22:20)

Run the code above in your browser using DataLab