CS2 Paper B exam code

Discussion in 'CS2' started by Arny01, Feb 19, 2020.

Tags:
  1. Arny01

    Arny01 Member

    Hi,

    In the CS2 paper B exam, do you have to write the arguments of an R function out in full to get full marks? For example in the April 2019 paper B question 2iia), to simulate 1,000 values from a distribution in the exam report gives the code:

    > LNorm_Vector <- rlnorm(1000, meanlog = 0, sdlog = 1)

    or could you just write it without meanlog and sdlog, see below, to get full marks?
    LNorm_Vector <- rlnorm(1000 , 0, 1)

    Thanks
     
  2. Andrew Martin

    Andrew Martin ActEd Tutor Staff Member

    Hi

    I can't see why you wouldn't get full marks for the latter (I note that the 2020 Core Reading R code does not specify the argument names in their rlnorm example). That being said, be careful as you'll need to ensure the arguments are in the order expected by R if you are not specifying their names.

    Assuming you're working in RStudio, if you wanted to write the argument names out and save yourself some time, you can start writing the argument name and press tab. In the below I have typed "m" and pressed tab. You can then select from the drop down and it will complete the argument name for you.

    upload_2020-6-1_16-8-7.png

    Hope that helps

    Andy
     

Share This Page