• We are pleased to announce that the winner of our Feedback Prize Draw for the Winter 2024-25 session and winning £150 of gift vouchers is Zhao Liang Tay. Congratulations to Zhao Liang. If you fancy winning £150 worth of gift vouchers (from a major UK store) for the Summer 2025 exam sitting for just a few minutes of your time throughout the session, please see our website at https://www.acted.co.uk/further-info.html?pat=feedback#feedback-prize for more information on how you can make sure your name is included in the draw at the end of the session.
  • Please be advised that the SP1, SP5 and SP7 X1 deadline is the 14th July and not the 17th June as first stated. Please accept out apologies for any confusion caused.

CS2 Paper B exam code

A

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
 
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
 
Back
Top