forked from mrjc42/SCRICompBioCourses
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcourse3.Rmd
More file actions
54 lines (32 loc) · 1.39 KB
/
course3.Rmd
File metadata and controls
54 lines (32 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
title: "Coding with R"
author: "Marc, Sean, Bronson and Debbie"
date: "10/7/2015"
output: html_document
---
Welcome to our third course which aims to take you from a basic ability to interact with the language to one where you are able to write some real code. From the outset we will try to warn you about bad habits so that you will avoid making some of the mistakes that most other people make when they start programming in R.
Here is a list of topics that should be covered by the end of this course:
# How to create basic functions
### The basics
# Writing good code in R
### check your arguments when writing functions
### write short functions
### Don't repeat yourself (DRY)
### always check if someone else has solved the problem
# Some pitfalls specific to R
#### forgetting to vectorize
#### the loop with a big appetite
#### hidden arguments and default behaviors [,drop=TRUE]
# Literate programming.
### What is an .Rmd file?
### Reproducible research
# How to write S4 methods (and why)
### methods are not the same thing as functions
### Why would you do this? (elegant dispatch)
### What is a Generic and when do I need to care?
# version control.
### So you don't lose your mind
# Write good packages (this is likely a whole other course)
#### use your namespace (don't export everything)
#### use live code blocks and unit tests
#### use toy examples to verify that code works