Learn R Programming

matRiks

The goal of matRiks is to generate Raven-like stimuli according to rules. This package has been developed by Dr. Andrea Brancaccio and Dr. Ottavia M. Epifania.

What it does

The matRiks package is a convenient tool for generating Raven-like stimuli according to both logical rules (i.e., the relationships between the elements in the matrix are manipulated to create the matrix) and visuospatial rules (i.e., the visual or spatial characteristics of the elements are manipulated to generate the matrix). The response list associated with each matrix is generated as well, containing 11 response options (i.e., one correct response and 10 distractors) among which the users can choose the most apt for their aims. The distractors are bound to both the rules and the directional logic that have been used for generating the matrix. As such, not all the distractors can be generated for all the matrices. In case a distractor can not be generated for a given matrix, a warning is thrown and the distractors is covered by a thick black X.

Installation

You can install the development version of matRiks from GitHub with:

# install.packages("devtools")
devtools::install_github("OttaviaE/matRiks")

Example

This code provides an example on how to generate a basic matriks by using one figure (pacman()) and manipulating its rotation (rotate) horizontally:

library(matRiks)
#> Warning: il pacchetto 'matRiks' è stato creato con R versione 4.3.2
#> 
#> Caricamento pacchetto: 'matRiks'
#> Il seguente oggetto è mascherato da 'package:methods':
#> 
#>     show
#> I seguenti oggetti sono mascherati da 'package:base':
#> 
#>     identity, replace
## Generate a simple matriks by horizontally rotating a pacman
my_mat <- mat_apply(pacman(), hrules = "rotate")
# draw the matriks 
draw(my_mat)

Along with the matriks, its associated response list can be generated as well:

# generate the response list
responses <- response_list(my_mat)
#> Warning in repetition.matriks(obj): R-Top is equal to the correct response
#> Warning in ic_inc.matriks(obj): IC-Inc cannot be obtained with a single figure
# draw the response list and print the title of the distractors
draw(responses, main = TRUE)

Since two distractors cannot be generated given the rule and the directional logic used for generating the matriks, two warnings are thrown and the related distractors are crossed out by a thick black X.

This code print a small selection of distractors:

draw(responses, main = TRUE, distractors = c("correct", "r_diag", "wp_matrix", "difference", "ic_flip"))

Copy Link

Version

Install

install.packages('matRiks')

Monthly Downloads

254

Version

0.1.3

License

MIT + file LICENSE

Maintainer

Andrea Brancaccio

Last Published

February 16th, 2024

Functions in matRiks (0.1.3)

hide

Hide figures (Method)
luck

Coordinates of a luck
ninja

Coordinates of a ninja star
rotate

Rotation rule (Method)
malta

Coordinates of a Malta cross
semi_circle_bottom_inv

Coordinates of an upward-facing left semi-circle
shade

Shade rule (Method)
semi_circle_top

Coordinates of a downward-facing left semi-circle
show

Show figures (Method)
triangle

Coordinates of a triangle
margin

Margin rule (Method)
mat_apply

Apply rule to generate a matriks (method)
shape

Shape rule (Method)
star

Coordinates of a star
slice

Coordinates of a pizza slice
pentagon

Coordinates of a pentagon
pacman

Coordinates of a pacman
maxi

Coordinates of a maxi
phantom

Coordinates of a panthom figure
up_petal

Define the coordinates of petals
size

Sizing rule (Method)
hexagon

Coordinates of a hexagon
pizza_4

Coordinates of a pizza with four slices
repetition

Repetition distractors (Method)
v_arc_left_up

Coordinates for drawing circle arches
vert_bow_tie

Coordinates of bow ties
wp

Wrong principle distractors (method)
miley

Define the coordinates of a miley
replace

Replace figures (Method)
response_list

Response list (Method)
vertical_s

Coordinates of S-shaped figures
vline

Coordinates of lines
vertical_eight

Eight-shaped figures
split_mat

Split the correct response (Method)
square

Coordinates of a square
cross

Coordinates of a cross
dice

Coordinates of a dice with four dots
decof

Split the elements of a figure (Method)
difference

Difference distractor (Method)
change_color

Change shade
correct

Correct response (Method)
cof

Concatenation of figures (method)
hide.figure

Hide figures
circle

Coordinates of a circle
ic

Incomplete correlate distractors (method)
ellipse

Coordinates of an ellipse
axe

Coordinates of an axe
dot

Coordinates of a dot
draw

Draw (Method)
identity

Identity rule (Method)
biscuit

Coordinates of a biscuit
lily

Define the coordinates of a lily
logic

Logical rules (Method)