Assignment 6 - FCB 2022
Deadline: 11/11/2022 - 23:59
Submission procedure
This assignment has to be submitted using GitHub Classroom. This means that you should have cloned the GitHub repo of this assignment from the organization account for FCB in the academic year 2022-23 at https://github.com/funcompbio2022 using the submission link provided at the FCB Moodle site.
Once you have cloned the GitHub repo which has assignment-6
and your
GitHub username as repo name, then you can work on it in your local disk
and push your changes whenever you like, but make sure that you have pushed
the last version of your assignment before the deadline. There is no
submit button or any other specific submission procedure or action than
just pushing your changes to you GitHub assignment repo. When correcting the
assignment, the version available at the deadline will be retrieved. If the
first version available is posterior to the deadline, then the mark of the
assignment will have a penalty.
To complete your submission (see rubric below) please agree to the following
academic integrity statement by editing this README file and placing the
letter X
between the squared brackets preceding the statement:
- [] The work here submitted has been entirely developed by myself and is the result of my own work.
Description
The goal of this assignment is to create an R script that produces a CSV file
called COVID19CATlast6months.csv
with COVID19 data for Catalonia derived from
the general population, starting on June 1st, 2021, with older data at the
beginning of the file and more recent data at the end of the file. To achieve
this goal you should follow these 2 steps:
- Create an R script called
analysis.R
with the R commands that read the CSV filecatalunya_setmanal.csv
provided in the repo of the assignment and make the necesssary transformations and calculations to obtain adata.frame
object with the columnsDATA_INI
,R0_CONFIRMAT_M
,IA14
andPERC_PCRTAR_POSITIVES
, whose first lines look like this:
DATA_INI R0_CONFIRMAT_M IA14 PERC_PCRTAR_POSITIVES
1 2021-06-01 0.937658 102.9883 3.5296
2 2021-06-02 0.952521 99.3055 3.5322
3 2021-06-03 0.965133 96.5175 3.5561
4 2021-06-04 0.973635 94.3649 3.6365
5 2021-06-05 0.972995 92.0826 3.5797
6 2021-06-06 0.965863 91.2267 3.5496
- Let the
data.frame
object of the resulting data be calleddtf
, the last line of your script should write to disk that object into a CSV file calledCOVID19CATlast6months.csv
with the following R command:
write.csv(dtf, "COVID19CATlast6months.csv", row.names=FALSE)
Your assignment repo should have the following files:
- This
README.md
file. - The COVID19 data CSV file
catalunya_setmanal.csv
. - The R script file
analysis.R
. - The resulting CSV file
COVID19CATlast6months.csv
.
The file COVID19CATlast6months.csv
should have the following
characteristics:
- It should be a CSV file using the comma (
,
) as column separator and non-numeric values should be quoted with double quotes ("
). - It should have the following line as first (column header) line:
"DATA_INI","R0_CONFIRMAT_M","IA14","PERC_PCRTAR_POSITIVES"
- The second and following lines should contain the values corresponding
to the columns specified above, ordered by date with the oldest date in
the first row and the most recent in the last one. The data should be
derived from the general population, that is, excluding the data
from geriatric residences. For instance, the first line should look
like this one:
"2021-06-01",0.937658,102.9883,3.5296
This assignment incorporates an autograding feature using a so-called
GitHub Actions Worflow, which will
help you to automatically test whether your R script is
correctly working after every push. More concretely, a few minutes after
you pushed your changes to your remote GitHub repo, the badge labeled
FCB-Python-autograding
on top of this README file will be red and display
the message failing
if the autograding has not been successful, and
green with the message passing
otherwise. You may click on badge to
look at output of the autograding tests to understand why it has failed,
if that was the case. This feature provides you with
formative assessment
and to work with it you need to edit your R script in a file called
analysis.R
at the root of your GitHub repo and leave intact the file
catalunya_setmanal.csv
.
Evaluation rubric
The rubric to evaluate this assignment consists of the following items:
- Did you agree to the academic integrity statement?
- Does the assignment contain the required files?
- Does the file
COVID19CATlast6months.csv
contain the four required columns? - Is the file
COVID19CATlast6months.csv
ordered chronologically starting on June 1st, 2021 and does it contain the COVID19 data derived from the general population for the four required columns? - Does the R code run without errors?
- Does the R code produce the expected result?