mcq: Multiple choice questions (mcq) check.

Usage Arguments Details Value Examples

View source: R/mcq.R

Usage

1
mcq(x, opts, inv_fw = NA, fw = NA)

Arguments

x

table (data.frame/matrix) from data comes.

opts

options

inv_fw

change the invalid options with inv_fw. Default to NA. If NULL it keeps the original values.

fw

fillwith. If inv_fw = NA it will be overwriten by fw.

fc

fill with to check visually

Details

All x, opts, fw and fc must be the same class

Value

x with elements different of opts or blanks (NA) filled with fc, and NA's are filled with fw

Examples

1
2
3
4
5
6
7
xe <- c(3, "o.9", 8)
mcq(xe, 1:3)

xe <- c(3, 0, 8, NA)
mcq(x = xe, opts = 0:3, fw = -99.009)
mcq(x = xe, opts = 0:3, fw = NA, inv_fw = NULL)
mcq(x = xe, opts = 0:3)

mathphysmx/cleanTable documentation built on May 29, 2019, 2:51 p.m.