732A94 AdvancedRHT2024 Lab05
732A94 AdvancedRHT2024 Lab05
Computer lab 5
• Copying solutions of others and from any online or offline resources is NOT allowed.
• Commit continously your addition and changes.
• Collaborations should be done using GitHub (ie you should commit using your own github account)
or using GitLab.
• In the lab some functions can be marked with an *. Students MUST do AT LEAST ONE
exercise marked with an * for each of the Labs 3 - 6 and Bonus. If only one exercise is marked with
an *, then it MUST be done.
• The deadline for the lab is on the lab’s title page.
• The lab should be turned in using an url to the repository containing the package on github/gitlab.liu.se
using LISAM. This should also include name, liu-id and, if applicable, github user names of the
students behind the project. In case of problems or if you do not have access to LISAM the url
may be emailed to baybr79@liu.se or marbr987@student.liu.se or araha147@student.liu.se
or krzysztof.bartoszek@liu.se.
• NO resubmissions will be allowed for the Bonus lab.
NO late submissions will be allowed for the Bonus lab.
• Inside your package you may not depend on any global variable (unless it is a standardR one, like
pi). Using them will result in an immediate failure of your code.If at any stage your code changes
any options, these changes have to be reverted before your code finishes.
• All notes raised by Travis/GitHub Actions/GitLab CI have to be taken care of or explicitly defended
in your submission.
• The seminars are there to discuss your solutions and obtain support with problems. Every group
has to present at least once during the seminars in order to pass the lab part.
1
LINKÖPING UNIVERSITY
STIMA
Department of Computer and Information Science Advanced R programming
Contents
Chapter 1
In this lab we will will create a package to connect to a web API using R. The purpose of this lab is to
start the work with a API package you will use and develop further during the course. You can choose
a connection to any API you find to have interesting data to analyze as well (you may use this data in
a machine learning project in the last lab). If the project is good enough you will be able to submit this
package to CRAN during the last week.
The API needs to be accepted by the teacher before you start. In the document
732A94 AdvancedRHT2017 Lab05 API projects.pdf you can find API:s suggestions to implement as an
R package.
Master students will also implement a simple Shiny application using the package to connect to the
API.
1. Show that the package can be built using R Studio and that all unit tests is passing.
2. Discuss why you implemented the functions as you did.
3. Give a short presentation of the testsuite.
1.3.1 Examination
Turn in a the adress to your github or gitlab repo with the package using LISAM. To pass the lab you
need to:
1. Have the R package up on GitHub with a Travis CI, GitHub Actions, or GitLab CI pass/fail badge.
2. The test suites for the implemented function(s) should be included in the package.
3. The package should build without warnings (pass) on Travis CI, GitHub Actions, or GitLab CI.
4. All issues raised by Travis CI / GitHub Actions / GitLab CI should be taken care or justified why
they are not a problem or cannot be corrected. Be careful with namespace issues, these you HAVE
to take care of.
4
LINKÖPING UNIVERSITY
STIMA
Department of Computer and Information Science Advanced R programming
Bibliography
[2] Hadley Wickham. testthat: Get started with testing. The R Journal, 3(1):5–10, 2011.
[3] Hadley Wickham. R packages. ” O’Reilly Media, Inc.”, 2015.