Generate matRiks

This vignette illustrates how to create an RMarkdown file that can include both the generation of the matriks and of its related distractors. As such, the users can concurrently visualize the matriks and the distractors, like in the following example:

Create an RMarkdown file

A new RMarkdown file can be created via File \(\rightarrow\) New File \(\rightarrow\) RMarkdown, then by choosing an RMarkdown document (preferably in PDF) from the dialogue window.

The YAML of the document should be modified to look like this:

---
title: "My matriks"
author: "The author"
date: "2024-02-16"
output:
  pdf_document:
    toc: yes
---

The YAML sets the title of the document (My matriks), the author (“The author”), the date, and other settings concerning the document. For instance, this YAML will generate a PDF document with a Table of Contents.

A setup chunk should be included to set the behavior of the code chunks throughout the document:

```{r setup, include=FALSE}
library(matRiks)
knitr::opts_chunk$set(
  echo = FALSE,
  eval = TRUE, 
  fig.align = 'center'
)
```

By setting echo = FALSE and eval = TRUE the code of each chunk will be executed (eval = TRUE) but the actual will not be displayed in the document (echo = FALSE)

You are all set to start generating your Raven-like matrices and the associated response lists!

matRiks 1

The first matriks is a single-layer matriks where the shape is applied diagonally to three shapes, square(), pentagon(), and hexagon():

```{r}
m1 <- mat_apply(cof(square(), pentagon(), hexagon()), 
                hrules = "shape", vrules = "shape")
draw(m1)
```

The response list can be created with the function response_list(), which generates a list of length 11 containing the correct response and 10 distractors:

```{r}
dist_m1 <- response_list(m1)
draw(dist_m1, main = TRUE)
```
## Warning in ic_inc.matriks(obj): IC-Inc cannot be obtained with a single figure

A warning has appeared since some type of distractors cannot be generated given the type of matriks and/or the rules used for its generation. In this case, since it is a single-layer matriks it is not possible to generate the Incomplete Correlate-Incomplete distractors, which is also crossed with a thick black cross. The argument main set TRUE means that the names of the distractors are plotted as well.

The user can also specific a selection of the response options to associate to the matriks. The selection should be a character vector and it must be specified through the argument distractors of the draw() function.

## matriks 2

This code creates a multi-layer matriks with three layers. Different rules are used to manipulate different objects in each layer.

```{r}
m1 <- mat_apply(cof(square(), pentagon(), hexagon()), 
                hrules = "shape", vrules = "shape")

m2 <- mat_apply(pacman(), hrules = "rotate", vrules = "rotate")

m3 <- mat_apply(size(malta(), 3), hrules = "shade")

m <- com(m1, m2, m3)
draw(m)
```

The response list can be created with the function response_list(), which generates a list of length 11 containing the correct response and 10 distractors:

```{r}
dist_m <- response_list(m, seed = 123)
draw(dist_m, main = TRUE)
```

By setting the argument seed = 123 it is possible to change the figure used for the generation of the difference distractor:

And here there is the selection of distractors:

mirror server hosted at Truenetwork, Russian Federation.