plot_fa: Plot figural analogies.

View source: R/plotfa.R

plot_faR Documentation

Plot figural analogies.

Description

plot_fa plots figural analogies by reading the information previously stored in an object of class 'fa_items' generated with build_fa.

Usage

plot_fa(
  items,
  which = 0,
  mode = "A",
  language = "E",
  language.dir = "A",
  form.int = "A",
  form.ext = "A",
  size.shape = 1,
  size.dot = 2,
  size.line = 1,
  size.q = 3.5,
  size.word = 1.2,
  info = T,
  sep = ",",
  directory = F,
  switch.from = 0,
  switch.to = 0
)

Arguments

items

An object of class 'fa_items' generated with function build_fa. No default.

which

A numeric vector designating which isomorph(s) to plot. Plot all by default.

mode

A character string designating plot mode "A", "B" or "C". Plot mode "A" by default.

language

A character string designating English ("E"), German ("D") or Spanish ("S") language. Default is "E".

language.dir

A character string designating language for output files. "A" by default selects all languages.

form.int

A character string designating the form from "A" to "D" of the internal main shape, or "R" for random. Default is "A".

form.ext

A character string designating the form from "A" to "D" of the trapezium, or "R" for random. Default is "A".

size.shape

A number designating the size of every shape. Default is 1.

size.dot

A number designating the size of every shape dot. Default is 2.

size.line

A number designating the thickness of every shape. Default is 1.

size.q

A number designating the size of the question mark. Default is 3.5.

size.word

A number designating the size of the verbal options. Default is 1.2.

info

Should the applied rules and correct answers be informed? True by default.

sep

Field separator character of the "Info.csv" file. The default "," is recommended for English MS Office.

directory

A character string designating a folder in your PC where to store the isomorphs.

switch.from

Number 'p' designating an option from 1 to 8 to switch with 'q'.

switch.to

Number 'q' designating an option from 1 to 8 to switch with 'p'.

Details

Thorough information about the plot_fa function can be found in the cited research paper of Blum and Holling (2018). Make sure to read the PDF version of it, since it is clearer. Additional information can also be found on icar-project.com.

Value

A data frame containing rules applied and right answers when info = T by default, or an object of class 'fa_items' when which has length 1, its value is greater than 0 and both switch.from and switch.to are greater than 0.

Author(s)

Diego Blum blumworx@gmail.com

References

Blum, D., & Holling, H. (2018). Automatic generation of figural analogies with the IMak package. Frontiers in psychology, 9(1286), 1-13. <DOI:10.3389/fpsyg.2018.01286>

See Also

build_fa

Examples

## Create two isomorphs with one rule and set the correct answer to 1:
one <- build_fa(isomorphs = 2, dot.mov = c(1, 2), correct = 1)
## Plot them:
plot_fa(one)
## Change the correct answer of item 2 from position 1 to position 2:
one <- plot_fa(one, which = 2, switch.from = 1, switch.to = 2)
## Choose a directory and save the items:
# dir1 <- "enter your new directory here"
# plot_fa(one, directory = dir1)

## Create four isomorphs with two rules:
two <- build_fa(isomorphs = 4, mirror = 1, trap.rot = c(90, 45))
## Plot them in German language:
plot_fa(two, language = "D")
## Plot only items 2 and 3 in Spanish and choose form "B" for the internal main shape:
plot_fa(two, language = "S", form.int = "B", which = c(2, 3))
## Choose a different directory and save these two items by keeping the latter configuration:
# dir2 <- "enter your new directory here"
# plot_fa(two, which = c(2, 3), language.dir = "S", form.int = "B", directory = dir2)

## Create 20 isomorphs with three rules. Set automatic = FALSE 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)
## Plot each individual shape of item 13 in German language only:
plot_fa(three, which = 13, mode = "C", language = "D")
## Save the item parts in a different folder. Re-import them to create and save another plot:
# dir3 <- "enter your new directory here"
# plot_fa(three, which = 13, mode = "C", language.dir = "D", directory = dir3)
# afs(sa = "item13a.png", sb = "item13b.png", sc = "item13c.png",
# s1 = "item13op1.png", s2 = "item13op2.png", s3 = "item13op3.png",
# s4 = "item13op4.png", s5 = "item13op5.png", s6 = "item13op6.png",
# s7 = "item13op7.png", s8 = "item13op8.png", ai.idn = T, path = dir3)

IMak documentation built on May 2, 2022, 5:08 p.m.

Related to plot_fa in IMak...