BIOS 346 Homework Guidelines

Some formatting recommendations

please:
  • start each problem on a new page
  • write your name on each page
  • Staple each problem separately, and attach all your problems together with a binder clip or paper clip
  • print or write single-sided (helps me to look at equations or code that spans multiple pages)
  • handwritten answers are fine as long as it is legible
  • code tips
    • See ProgrammingPrincipals and ProgrammingTipsForStatisticians for tips. These pages should probably be merged. In fact that could be a nice project for something with which to amuse oneself. You may have your own opinion about some of the tips on these pages, but in general, try to strike a balance between saving typing, efficient calculations, and readability, keeping in mind someone else may have to read your code (as in homework!), or you may have to read it after several months or years.
    • If you can, print the code in color if you are using knitr or something that automatically colors your code.
    • Name variables thoughtfully. Try to avoid many variations of a string as variable names that might get mixed up within the same code. For example, beta0, beta_0.
      • Don't be afraid to use longer variable names for clarity.
      • If you have multiple words in a variable name, you can use camel case for readability, e.g. beta0Est

If you are interested in knitr, you may want to see this page with tips on knitr: KnitrHowto.

Caching R results

  • If you are using knitr, there is an easy way to store results for long computations. See caching on KnitrHowto.
  • In Sweave, you can use weaver, which is described here: SweaveWeaver. There is also the cacheSweave package, but I haven't used it.
Topic revision: r4 - 18 Feb 2013, JoAnnAlvarez
 

This site is powered by FoswikiCopyright © 2013-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Vanderbilt Biostatistics Wiki? Send feedback