Promoting the use of R in the NHS

Blog Article

This post was originally published on this site

(This article was first published on R/exams, and kindly contributed to R-bloggers)

Exercise template for solving a system of three linear equations (numeric answer) with a problem description based on shuffled images.

Name:
fruit
Type:
Related:
Description:
A system of three linear equations has to be solved and the solution has to be entered into a fourth equation. However, the system is not defined through a verbal description or mathermatical notation but through images (clip art of tropical fruits). The problem can be interpreted as prices of three fruits (banana, orange, pineapple) and corresponding fruit baskets with different combinations of fruits. Images are stored in Base64 encoding within the exercise files and embedded dynamically into the output. PDFs are best generated from the Rnw version, HTML is best generated with pandoc from either the Rmd version (where pandoc is used by default) or the Rnw version (where ttm is used by default, but pandoc can be easily used as well.)
Solution feedback:
Yes
Randomization:
Random numbers, shuffled graphics
Mathematical notation:
Yes
Verbatim R input/output:
No
Images:
Yes
Other supplements:
No
Template:
Raw: (1 random version)
PDF:
fruit-Rnw-pdf
fruit-Rmd-pdf
HTML:
fruit-Rnw-html
fruit-Rmd-html

(Note that the HTML output contains mathematical equations in MathML. It is displayed by browsers with MathML support like Firefox or Safari – but not Chrome.)

Demo code:

library("exams")

set.seed(1090)
exams2html("fruit.Rnw")
set.seed(1090)
exams2pdf("fruit.Rnw")

set.seed(1090)
exams2html("fruit.Rmd")
set.seed(1090)
exams2pdf("fruit.Rmd")

To leave a comment for the author, please follow the link and comment on their blog: R/exams.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more…

Comments are closed.