Last data update: 2014.03.03

R: Build figural analogies.
build_faR Documentation

Build figural analogies.

Description

build_fa generates the information of figural analogies.

Usage

build_fa(isomorphs = 1, main.rot = c(0, 0), mirror = 0, trap.rot = c(0,
  0), subtract = c(0, 0), dot.mov = c(0, 0), a.main = "R", a.flip = "R",
  a.trap = "R", a.dot = "R", constrict = F, al.main.rot = 0,
  al.mirror = 0, al.trap.rot = 0, al.subtract = 0, al.dot.mov = 0,
  correct = 0, add.rule = 0, automatic = T)

Arguments

isomorphs

A number of isomorphic items to be developed.

main.rot

A numeric vector with two main shape rotation values multiple of 45 and between -135 and 180. No rotation: 0.

mirror

A number designating the presence of shape reflection or no reflection (i.e., 1 or 0).

trap.rot

A numeric vector with two trapezium rotation values multiple of 45 and between -135 and 180. No rotation: 0.

subtract

A numeric vector with two line segments of the main shape to subtract from 1 to 5, or letter "R" for a random subtraction. No subtraction: 0.

dot.mov

A numeric vector with two dot edge movement amounts, with a maximum of 5 movements in total. No dot edge movement: 0.

a.main

A numeric vector with possible rotation states of the main shape of Figure A from 1 to 8. Random by default.

a.flip

A logical value designating whether Figure A is flipped with respect to its vertical axis or not (i.e., T or F). Random by default.

a.trap

A numeric vector with possible rotation states of the trapezium of Figure A from 1 to 8. Random by default.

a.dot

A numeric vector with possible dot positions in Figure A from 1 to 6. Random by default.

constrict

A character string designating a part of Figure A to display all possible positions every 'n' isomorphs.

al.main.rot

A numeric vector with alternative main shape rotation solutions. Random by default.

al.mirror

A numeric vector with alternative reflection solutions. Random by default.

al.trap.rot

A numeric vector with alternative trapezium rotation solutions. Random by default.

al.subtract

A numeric vector with alternative subtraction solutions. Random by default.

al.dot.mov

A numeric vector with alternative dot edge movement solutions. Random by default.

correct

A vector with numbers ranging from 1 to 9 for correct response placements. Random by default.

add.rule

A number specifying which rule from 1 to 5 adds itself to the options of one-rule-based items. Random by default.

automatic

Should options be generated by the program? True by default.

Details

The argument isomorphs is the number of isomorphic items to be created. The arguments main.rot, mirror, trap.rot, subtract, and dot.mov are the so-called radical arguments. They designate how rules are applied to all the isomorphs. main.rot and mirror cannot be combined because it is unpractical (Blum et al., 2016). The arguments a.main.rot, a.flip, a.trap, and a.dot are the so-called incidental arguments. They affect how the upper-left shape of the main matrix (i.e., Figure A) presents itself in every isomorph. Setting constrict to "main", "trap" or "dot" displays all possible positions of a certain part of Figure A (main shape, trapezium or dot) every 'n' isomorphs. Radical arguments that use the prefix al. designate alternative solutions for each of the applied rules throughout the options by following a Solutions Combination Design (Blum et al., 2016). They are random by default when automatic=T. When automatic=F, values must be chosen, which designate rotation angles between the correct and the alternative solutions, or alternative reflection / subtraction / dot positions. Three things to keep in mind: 1. Three alternative solutions should be chosen for the main rule when working with only one rule. If add.rule is not altered, then all other rules should also comprise one alternative solution each. If add.rule designates a specific rule from 1 to 5, then the latter statement is only valid for this rule. 2. Two alternative solutions should be chosen for each rule of two-rule-based items. 3. One alternative solution should be chosen for each rule of items comprising more than two rules.

Value

An object of class 'fa_items', basically a list including elements to be plotted with function plot_fa.

Author(s)

Diego Blum <blumworx@gmail.com>

References

Blum, D., Holling, H., Galibert, M.S., & Forthmann, B. (2016). Task difficulty prediction of figural analogies. Intelligence, 56, 72-81.

See Also

IMak

Examples

## Create two isomorphs with one rule, setting the correct answer to 1:
one <- build_fa(isomorphs = 2, dot.mov = c(1, 2), correct = 1)
## Plot them:
plot_fa(one)

## Create four isomorphs with two rules:
two <- build_fa(isomorphs = 4, main.rot = c(180, 135), trap.rot = c(90, 45))
## Plot them:
plot_fa(two)

## Create 20 isomorphs with three rules. Set automatic=F and affect the options:
three <- build_fa(isomorphs = 20, mirror = 1, trap.rot = c(90, 45), dot.mov = c(1, 2),
automatic = FALSE, al.mirror = c(0, 1), al.trap.rot = -45, al.dot.mov = 1)
## Plot them:
plot_fa(three)

## Create and plot four two-rule based isomorphs, all of them comprising the same Figure A:
four <- build_fa(isomorphs = 4, a.main = 1, a.flip = FALSE, a.trap = 2, a.dot = 6,
mirror = 1, subtract = "R")
plot_fa(four)

## Create and plot 16 isomorphs by constricting the main shape rotation rule:
five <- build_fa(isomorphs = 16, subtract = c(1, 4), constrict = "main")
plot_fa(five)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(IMak)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/IMak/build_fa.Rd_%03d_medium.png", width=480, height=480)
> ### Name: build_fa
> ### Title: Build figural analogies.
> ### Aliases: build_fa
> 
> ### ** Examples
> 
> ## Create two isomorphs with one rule, setting the correct answer to 1:
> one <- build_fa(isomorphs = 2, dot.mov = c(1, 2), correct = 1)
> ## Plot them:
> plot_fa(one)
  Isomorphs Correct            General rules        Total
1         1       1        Dot edge movement            2
2         2       1                                      
> 
> ## Create four isomorphs with two rules:
> two <- build_fa(isomorphs = 4, main.rot = c(180, 135), trap.rot = c(90, 45))
> ## Plot them:
> plot_fa(two)
  Isomorphs Correct              General rules        Total
1         1       5        Main shape rotation            4
2         2       2         Trapezium rotation             
3         3       8                                        
4         4       8                                        
> 
> ## Create 20 isomorphs with three rules. Set automatic=F and affect the options:
> three <- build_fa(isomorphs = 20, mirror = 1, trap.rot = c(90, 45), dot.mov = c(1, 2),
+ automatic = FALSE, al.mirror = c(0, 1), al.trap.rot = -45, al.dot.mov = 1)
Warning messages:
1: In shape_options(options) :
  An alternative dot position solution had to be resampled in item 1.
2: In shape_options(options) :
  An alternative dot position solution had to be resampled in item 7.
3: In shape_options(options) :
  An alternative dot position solution had to be resampled in item 10.
4: In shape_options(options) :
  An alternative dot position solution had to be resampled in item 13.
5: In shape_options(options) :
  An alternative dot position solution had to be resampled in item 19.
> ## Plot them:
> plot_fa(three)
   Isomorphs Correct             General rules        Total
1          1       6                Reflection           20
2          2       5        Trapezium rotation             
3          3       7         Dot edge movement             
4          4       4                                       
5          5       3                                       
6          6       5                                       
7          7       8                                       
8          8       3                                       
9          9       5                                       
10        10       5                                       
11        11       3                                       
12        12       7                                       
13        13       6                                       
14        14       4                                       
15        15       3                                       
16        16       3                                       
17        17       6                                       
18        18       4                                       
19        19       5                                       
20        20       4                                       
> 
> ## Create and plot four two-rule based isomorphs, all of them comprising the same Figure A:
> four <- build_fa(isomorphs = 4, a.main = 1, a.flip = FALSE, a.trap = 2, a.dot = 6,
+ mirror = 1, subtract = "R")
Warning message:
In build_fa(isomorphs = 4, a.main = 1, a.flip = FALSE, a.trap = 2,  :
  All item matrices may match.
> plot_fa(four)
  Isomorphs Correct        General rules        Total
1         1       7           Reflection            4
2         2       5          Subtraction             
3         3       1                                  
4         4       6                                  
> 
> ## Create and plot 16 isomorphs by constricting the main shape rotation rule:
> five <- build_fa(isomorphs = 16, subtract = c(1, 4), constrict = "main")
> plot_fa(five)
   Isomorphs Correct        General rules        Total
1          1       7          Subtraction           16
2          2       2                                  
3          3       1                                  
4          4       4                                  
5          5       3                                  
6          6       1                                  
7          7       8                                  
8          8       5                                  
9          9       1                                  
10        10       7                                  
11        11       4                                  
12        12       1                                  
13        13       1                                  
14        14       4                                  
15        15       4                                  
16        16       7                                  
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>