Learn R Programming

compare (version 0.2-6)

markQuestions: Apply a Marking Scheme

Description

This function applies a marking scheme to a set of comparisons to produce a set of marks.

Usage

markQuestions(result, ...)

Arguments

result
A set of comparison results, as generated by the compareFiles() function.
...
One or more marking schemes, as generated by the questionMarks() function.

Value

A matrix of marks.

See Also

questionMarks and compareFiles

Examples

Run this code
modelNames <- c("id", "age", 
                "edu", "class", 
                "IndianMothers")
files <- list.files(system.file("example", package="compare"),
                    pattern="^student[0-9]+[.]R$",
                    full.names=TRUE)

results <- compareFiles(files,
                        modelNames,
                        system.file("example", "model.R", package="compare"),
                        allowAll=TRUE,
                        resultNames=gsub(".+[/]|[.]R", "", files))
q1 <- questionMarks(c("id", "age", "edu", "class"),
                    maxMark=2,
                    rule("id", 1),
                    rule("age", 1),
                    rule("edu", 1),
                    rule("class", 1,
                         transformRule("coerced", 1)))

q2 <- questionMarks("IndianMothers",
                    maxMark=1,
                    rule("IndianMothers", 1))

markQuestions(results, q1, q2)

Run the code above in your browser using DataLab