All code looks good but I have some comments on the format of your blog post.
What you had in the background section is mostly about the method you used for each question, but your method section was empty rather than some package loading messages. I would suggest you move each of the pieces into the corresponding section.
Add some description on how you approached each question, for example, in Q3, give the formula you used for absolute and relative errors before your code and final results. In Q4 and Q5, add one or two sentences to explain how you use different values of parameters to answer the questions.
You may want to make it clear that in Q4 what you plotted was the absolute difference, not just difference. If you plot the difference you will see some of the differences are below zero.
Use message = F in chunk header to suppress the package loading messages.
FAIL
All code looks good but I have some comments on the format of your blog post.
What you had in the background section is mostly about the method you used for each question, but your method section was empty rather than some package loading messages. I would suggest you move each of the pieces into the corresponding section.
Add some description on how you approached each question, for example, in Q3, give the formula you used for absolute and relative errors before your code and final results. In Q4 and Q5, add one or two sentences to explain how you use different values of parameters to answer the questions.
You may want to make it clear that in Q4 what you plotted was the absolute difference, not just difference. If you plot the difference you will see some of the differences are below zero.
Use message = F in chunk header to suppress the package loading messages.