Computing the worth of a randomly drawn number of shares in a certain currency. The main purpose of the exercise is to illustrate and test whether UTF-8 encoding works correctly.
Random numbers and text blocks
Verbatim R input/output:
(Note that the HTML output contains mathematical equations in MathML, rendered by MathJax using ‘mathjax = TRUE’. Instead it is also possible to use ‘converter = “pandoc-mathjax”’ so that LaTeX equations are rendered by MathJax directly.)
library("exams") set.seed(403) exams2html("currency8.Rmd", mathjax = TRUE) set.seed(403) exams2pdf("currency8.Rmd") set.seed(403) exams2html("currency8.Rnw", mathjax = TRUE) set.seed(403) exams2pdf("currency8.Rnw")