-
Notifications
You must be signed in to change notification settings - Fork 1
About Assignments
Most of the homework assignments require you to write code or carry out a set of calculation using R or Python. Your code and calculations should be prepared as literate programming documents to be processed by Sweave or Pweave.
IMPORTANT: Unless otherwise stated, assignments are due before the start of the next class session. Late submissions will receive zero credit.
When submitting your homework please follow these guidelines:
- In general, you should submit only two files each week -- a single Sweave file with all the R assignments and single Pweave files with any Python assignments. I do not need the generated LaTeX or PDF files -- I'll generate those on my end. Also, do not submit any standard data sets that I provide for the assignment or that are packaged as part of R.
- Name your files with the following convention:
<lastname>-<firstinitial>-<handsonweek>.Rnwfor Sweave documents and.Pnwfor Pweave documents. For example, for the assignments corresponding to Hands-on 2, my Sweave file would be:magwene-p-2.Rnw - If the assignment requires accessory functions, embed those functions in the Sweave/Pweave document.
- Except where explicitly required to do so, avoid calls that will print out long tables and data sets. For example, I don't need to see the entire
irisdata set printed out in every R assignments that uses it. - Test your Sweave/Pweave documents in a fresh directory (see below) before turning in your assignments
When I receive your assignment I will:
- process your documents using Sweave/Pweave
- Create PDF reports of successfully processed documents using pdflatex
- Check your code and calculations for correctness
If I'm unable to carry out steps 1 and 2 with the code you submit, I will return the document and ask you to fix any errors before I proceed to step 3. To minimize the instances in which the Sweave/Pweave document seems to compile fine on your computer, but not on mine please take the following steps to test your code before submitting any homeworks:
- Create an empty directory (e.g.
~/test) - Copy your Sweave/Pweave file to that directory
- Copy any data sets that your code needs to that directory
- For R:
- start a fresh R session and make sure your workspace is cleared by issuing this command:
remove(list = ls(all = TRUE)) - Sweave your document
- If it compiles fine and you're able to create a PDF with the correct output then it highly likely it will work fine on my machine
- For Python, test:
- Navigate to the directory
- From the command prompt, confirm you can process the files with the command:
Pweave -ftex filename(orPweave.py -ftex filenameon Windows) - Check the PDF for correctness as above