Quiz: reproduce and share a report

Lecture · Exercises · Weekly revision

Try each question before opening its hint or answer.


Q1. A report uses an object imported only in the R console. Which check is most likely to expose this dependency?

  1. Change the plot colour.

  2. Restart R and Knit from the saved source.

  3. Rename the HTML.

Restarting clears interactive session objects.

(ii). The report should create its objects in its own chunks. Add the import before the analysis that uses it.


Q2. A share folder contains introcomputing.Rproj and duckweed-report.html. Is that enough to recalculate the analysis for new data? What is missing?

A project file sets context; HTML displays a result.

No. Include the .Rmd source, actual input CSV, dictionary, required output folder, and README naming packages and the file to render. The .Rproj does not contain the dataset.


Q3. In a disposable project copy, the input CSV is renamed but the report still requests its old path. In another copy, only the prose is changed to falsely say every duckweed flask had a measured outcome. Which fault should stop rendering?

Software can encounter an unavailable input without recognising a false scientific sentence.

The unchanged path to the renamed input should cause a file error. The false prose may render successfully, so counts and interpretation also need review.


Q4. A report renders correctly after extraction into a new folder. Which claim follows?

  1. The source and supplied inputs regenerate the result in the tested environment.

  2. The scientific interpretation is proved correct.

  3. The ZIP protects against losing the only disk.

Reproduction, scientific validity and backup are separate checks.

(i). Successful reproduction is evidence about the tested source, inputs and environment. Design and interpretation still need review, and disk loss needs a separately stored backup.


Q5. You make report-share-v1.zip, then correct a sentence in report-share/README.txt. A colleague extracts v1. Do they see the correction?

A ZIP stores the folder as it was when the ZIP was made.

No. Make a new, newly named ZIP (report-share-v2.zip), extract it into a new folder, and check that the corrected sentence is there before sending it.


Q6. You run unzip report-share-v1.zip -d receiver-v1. Where is duckweed-report.Rmd, and why?

The ZIP was made from the folder report-share/.

At receiver-v1/report-share/duckweed-report.Rmd. Extraction keeps the packed folder, so it adds one level inside the destination. Open receiver-v1/report-share/introcomputing.Rproj to test it.


Q7. You run zip -r report-share-v1.zip report-share/ from Documents, the folder that contains report-share. Where is the ZIP saved, and why is that better than saving it inside report-share?

Where is the new ZIP saved?

In Documents, beside report-share, because a new ZIP is saved in the current folder. A ZIP kept inside the folder it packs would be packed into the next ZIP, which would then contain an old copy of itself.