Answering questions using R

For a question that uses R, it is necessary to include the R code and the outputs from the calculations, including graphs (if relevant), in the submitted Word document. Possible approaches for completing the answer booklet include:

    1) Incorporate the output and any necessary notes into the script file as comments. At the end, copy all the script (CTRL+A → CTRL+C) and paste it (CTRL+V) into the Word document.

    2) Clear the console window (CTRL+L) and then run all the code (CTRL+A → CTRL+ENTER) so that the answers and code are displayed in the console window. At the end, copy the entire console window (right click → Select all → CTRL+C) and then paste it as unformatted text (right click → Paste Options → Keep Text Only (T)) into the Word document. It may still be necessary to provide notes, either as a script comment or directly in the answer booklet, for some of the answers.

    3) Copy the code and output for each question into the Word document, and then type the answers for that question directly into the Word document.

If you are using a MacBook, the commands above require use of the Command key rather than CTRL, except for clearing the console, which is still CTRL+L.

To copy graphs into the answer booklet from the plot viewer within RStudio, select 'Export' → 'Copy to Clipboard' and press 'Copy Plot'.

Lion Background

Certified Actuarial Analyst

We are specialist actuarial educators and we are producing a wide range of affordable, online study resources to prepare students studying for the Certified Actuarial Analyst (CAA) exams offered by CAA Global.

Find Out More