Skip to content

Commit

Permalink
update spelling and add WORDLIST
Browse files Browse the repository at this point in the history
  • Loading branch information
zkamvar committed Nov 30, 2018
1 parent 1209827 commit 68ddb30
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 11 deletions.
47 changes: 47 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
analyse
behaviour
colours
conf
csv
customisation
customisations
Customise
devtools
epi
epicurve
epicurves
EPIET
EVD
Fitzjohn
ggplot
github
grey
Höhle
http
iso
ISOweek
isoweeks
Jombart
Kamvar
knitr
modelled
modelling
Modelling
POSIXct
pre
pred
Programme
randomised
repidemicsconsortium
rmarkdown
Thibaut
timespan
toc
VignetteEncoding
VignetteEngine
VignetteIndexEntry
visualise
www
Www
yyyy
Zhian
15 changes: 10 additions & 5 deletions vignettes/customize_plot.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ i.hosp

# The `plot.incidence` function

When calling `plot` on an *incidence* object, the function `plot.incidence` is implicitely used. To access its documentation, use `?plot.incidence`. In this section, we illustrate existing customizations.
When calling `plot` on an *incidence* object, the function `plot.incidence` is implicitly used. To access its documentation, use `?plot.incidence`. In this section, we illustrate existing customisations.


## Default behaviour
Expand All @@ -92,15 +92,20 @@ args(incidence:::plot.incidence)

### The default palette

A color palette is a function which outputs a specified number of colors. By default, the color used in *incidence* is called `incidence_pal1`. Its behaviour is different from usual palettes, in the sense that the first 4 colours are not interpolated:
A color palette is a function which outputs a specified number of colors. By
default, the color used in *incidence* is called `incidence_pal1`. Its
behaviour is different from usual palettes, in the sense that the first 4
colours are not interpolated:

```{r, incidence_pal1, fig.height = 8}
par(mfrow = c(3,1), mar = c(4,2,1,1))
par(mfrow = c(3, 1), mar = c(4,2,1,1))
barplot(1:2, col = incidence_pal1(2))
barplot(1:4, col = incidence_pal1(4))
barplot(1:20, col = incidence_pal1(20))
```

This pallette also has a light and a dark version:
This palette also has a light and a dark version:

```{r, pal2, fig.height = 8}
par(mfrow = c(3,1))
barplot(1:20, col = incidence_pal1_dark(20), main = "palette: incidence_pal1_dark")
Expand Down Expand Up @@ -158,7 +163,7 @@ Numerous tweaks for *ggplot2* are documented online. In the following, we merely
### Changing date format

By default, the dates indicated on the *x*-axis of an incidence plot may not have the suitable format.
The package *scales* can be used to change the way dates are labelled (see `?strptime` for possible formats):
The package *scales* can be used to change the way dates are labeled (see `?strptime` for possible formats):

```{r, scales1}
library(scales)
Expand Down
2 changes: 1 addition & 1 deletion vignettes/incidence_class.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ get_dates(i.date, position = "center", count_days = TRUE)
The `$counts` component contains the actual incidence, i.e. counts of events
for the defined bins. It is a `matrix` of `integers` where rows correspond to
time intervals, with one column for each group for which incidence is computed
(a single, unamed column if no groups were provided). If groups were provided,
(a single, unnamed column if no groups were provided). If groups were provided,
columns are named after the groups. We illustrate the difference comparing the
two objects `i` and `i.sex`:

Expand Down
6 changes: 3 additions & 3 deletions vignettes/incidence_fit_class.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ An `incidence_fit` object contains three elements:
- `r` The growth rate
- `r.conf` the confidence interval of `r`
- `pred` a data frame containing the predictions of the model using the true
dates (`dates`), their numberic version used in the model (`dates.x`), the
dates (`dates`), their numeric version used in the model (`dates.x`), the
predicted value (`fit`), and the lower (`lwr`) and upper (`upr`) bounds of
the associated confidence interval.
- `doubling` the predicted doubling time in days (only if `r` is positive)
Expand All @@ -48,7 +48,7 @@ An `incidence_fit` object contains three elements:

Internally, when `fit()` is run, these elements are constructed by
function `incidence:::extract_info()`. First we need to setup data. We will use
simulated ebola outbreak data from the *outbreaks* package over weekly intervals
simulated Ebola outbreak data from the *outbreaks* package over weekly intervals
and calculate the fit for the first 20 weeks:

```{r fit_dates}
Expand Down Expand Up @@ -226,7 +226,7 @@ get_info(fl$fit, "doubling.conf", na.rm = FALSE)

Above, we showed the example of a basic `incidence_fit_list` class with two
objects representing the fits before and after the peak of an epicurve. However,
it is often useful evaulate fits for different groups separately. Here, we will
it is often useful evaluate fits for different groups separately. Here, we will
construct an incidence object, but define groups by gender:

```{r incidence_by_gender}
Expand Down
4 changes: 2 additions & 2 deletions vignettes/overview.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ The main functions of the package include:
- **`fit_optim_split`**: finds the optimal date to split the time series in two,
typically around the peak of the epidemic.

- **`[`**: lower-level subsetting of *incidence* objects, permiting to specify
- **`[`**: lower-level subsetting of *incidence* objects, permitting to specify
which dates and groups to retain; uses a syntax similar to matrices,
i.e. `x[i, j]`, where `x` is the *incidence* object, `i` a subset of dates,
and `j` a subset of groups.
Expand Down Expand Up @@ -173,7 +173,7 @@ plot(i.7.hosp, stack=TRUE) +


## Handling `incidence` objects
`incidence` objects can be manipulated easily. The `[` operator implements subetting of dates (first argument) and groups (second argument).
`incidence` objects can be manipulated easily. The `[` operator implements subsetting of dates (first argument) and groups (second argument).
For instance, to keep only the peak of the distribution:
```{r, middle}
i[100:250]
Expand Down

0 comments on commit 68ddb30

Please sign in to comment.