ISTA 321 How to format your homework

Nicholas DiRienzo

How to format your homework for ISTA 321

Hey everyone - Just a quick overview of how I want homework to be submitted. Any coding based assigment should be uploaded to D2L as an R script. All scripts should have a properly formatted filename, your info at the top of the script, and clear annotation througout, and answering any questions. Details on these points:

New R scripts vs. template

Sometimes I’ll provide a template, in which case you can just modify it for the homework. Other times you’ll just have to startfrom scratch. In that case you’ll need a new R script… just go to File -> New -> R Script here in R Studio to open a new one.

Filenames

All r scripts should be saved with the format lastname_assignmentweek. So my homework for week two would be dirienzo_week2

Info within file

You should also include within your R script the author info (you!), assignment name, date, and class info. If you don’t remember, you can use a # to make it so your text isn’t run in your script. For example:

Annotating your code

Proper annotation is key to allowing yourself and others actually know what you did! There’s nothing more frustating than opening up something you made months/years ago and not having any annotation to explaing why you did something! You don’t need to go crazy, but adding text before or during coding something out is helpful and necessary.

For example, don’t just do this

Instead, add some annotation to explain what you’re doing and why. For example:

The above is enough to give an idea you identifying a problem, digging into it more, and explaining the logic of your solution.

Answering any questions

There will be times where I ask questions, either through a prompt in a template, or as part of a coding assigment where you’re starting from scratch. Whatever the case, you can just respond with a mix of text and code in the script.

If there is a prompt, I will put #QUESTION - and write out the question. You should then respond with #MY ANSWER - and the answer to the question.

If I didn’t give a template but instead provided a pdf or something of your assigment, you can use the same format as above but just write down the question number you’re responding to. For example, if I have a question about data frame slicing and it’s question number 3, the following would work: