-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathREADME.Rmd
More file actions
152 lines (111 loc) · 4.94 KB
/
README.Rmd
File metadata and controls
152 lines (111 loc) · 4.94 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
TeachStatsWithR
===============
```{r include=FALSE}
require(mosaic)
```
Materials for the MOSAIC "Teaching Statistics with R and RStudio"
### Compiling
The content of each book is in a separate directory. That directory has a subdirectory, `Master` with a file `Master-*.Rnw`.
Each of the `.Rnw` files in the content directory can be compiled on it's own. Just "Knit HTML" in RStudio. This will create a PDF file.
To create the whole book, you need to recompile each `.Rnw` after setting a variable, `notAsStandAlone=TRUE`. The process is
```{r eval=FALSE}
require(knitr)
# Change to the directory, e.g. "Starting"
setwd("Starting") # go to your own directory
standAlone=TRUE
fnames <- list.files(pattern="*.Rnw$") # files to recompile
for (fnm in fnames) knit(fnm)
```
### Outline
This project consists of several short books that are inter-related.
1. Start Teaching with R
Directory: `Starting`
2. The Core of a Traditional Course
Directory: `Traditional`
3. Simulation-Based Inference
Directory: `Simulation`
4. Functions and Formulas
Directory: `Functions`
5. Teaching with Internet Services
Directory: `Internet`
6. Start with Modeling
Directory: `Modeling`
APPENDICES
A. Style instructions for authors
B. Possible additional topics
Outlines for the individual chapters are in the `Outline.Rmd` file in each directory.
## Overview
Some general comments about the project as a whole.
```{r starting-outline,child='Starting/Outline-Starting.Rmd',eval=TRUE}
```
```{r traditional-outline,child='Traditional/Outline-Traditional.Rmd',eval=TRUE}
```
```{r simulation-outline,child='Simulation/Outline-Simulation.Rmd',eval=TRUE}
```
```{r functions-outline,child='Functions/Outline-Functions.Rmd',eval=TRUE}
```
```{r internet-outline,child='Internet/Outline-Internet.Rmd',eval=TRUE}
```
```{r modeling-outline,child='Modeling/Outline-Modeling.Rmd',eval=TRUE}
```
Appendix A: Style Instructions for Authors
=======================
Notes for the authors can be included using `\authNote{A note to the authors.}`
Processed notes for the authors can be hidden using `\authNoted{A noted note to the authors.}`
## Some Style Guidelines
1. R Code
1. Use space after comma in argument lists
2. No space around = in argument list
3. Use space around operators, `<-` and `->`
4. Casual comments (no need for caps)
5. When referring to functions in the text, add empty parens (e.g., `data()`) to make it clear that the object is a function.
2. Exercises
N.B. Some exercises are for instructors, not for students.
1. Use `\begin{problem} ... \end{problem}` to define problems.
2. Use `\begin{solution} ... \end{solution}` to define solutions.
This must be \emph{outside} the `problem` environment and before the definition of the next problem. Put it immediately after `\end{problem}` to avoid confusion.
* Use `\shipoutProblems` to display all problems queued up since the last `shipoutProblems`.
* Examples
Put within `\begin{example}` and `end{example}`. We can tweak the formatting later.
* Marginal Notes
We can place some marginal notes with:
* `\InstructorNote{This is an instructor note.}`
* `\FoodForThought{We can tweak the layout, color, size, etc. later. For now. I'm just using color to distinguish.}`
* `\Caution{This is a caution}`
1. Variable names. Often it's nice to distinguish between anactual variable name and a word that might have a similar name, for instance between sex and `sex`. Use the `\VN{sex}` command to accomplish this.
1. Model formulas. Use `\model{A}{B+C}` to generate `A ~ B+C` . Often, you may want to use variable names, for instance `\model{\VN{height}}{\VN{age}+\VN{sex}}` gives `height ~ age + sex`.
### R-forge svn
The mosaic R-forge repository contains
* The `.Rnw` files
* The dependencies in `bin/`
* *LaTeX* dependencies in `inputs/`
* `problems.sty` (for problems and solutions)
* `authNote.sty` (for author notes)
* `probstat.sty` (for some prob/stat macros)
* `sfsect.sty` (for san serif section title fonts)
You may need to set an environment variable to make *LaTeX* look here.
* the `cache/` and `figures/` directories (so that `make` can be used
without complaint), but *not* their contents, which are generated by `sweave`.
* screenshots and other images not generated by `sweave` are in `images/`
Appendix B: Possible Additional Topics
=====================
Do we want to include any of these topics?
* Fancier Lattice Graphics
* Base Graphics
* Making plots with `ggplots2`
Only if one of us knows or wants to learn this system.
* Writing executable R scripts
* R Infrastructure for Teaching
Whatever of this we include might end up in the chapters rather than in
an appendix.
* Sharing in R Studio
* Public Data
* Google Data
* Making Data Available Online
* A Brief Tour of knitr and R-markdown
* exams
* Books
* Our books
* Chance et al (in progress)
* Existing books that work well/poorly with R (and why)
* Online materials