Skip to content

Commit

Permalink
fixed wording in extract_convert vignette and reduced db printing in …
Browse files Browse the repository at this point in the history
…epiparameter vignette
  • Loading branch information
joshwlambert committed Sep 6, 2023
1 parent 13874dc commit 514a7e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions vignettes/epiparameter.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ The `<epiparam>` class has a custom printing method which gives a summary of the
The `<epiparam>` class is based (i.e. inherits from) the data frame, and therefore the same subsetting and manipulation can be carried out, including the `head()` and `tail()` of the database.

```{r, subsetting-head-tail-epiparam}
head(epi_dist_db)[, 1:5]
tail(epi_dist_db)[, 1:5]
head(epi_dist_db)[, 1:4]
tail(epi_dist_db)[, 1:4]
```

The epidemiological library contains multiple columns, each storing different features of the parameter:
Expand Down Expand Up @@ -98,10 +98,10 @@ An `<epidist>` object can be converted from one of the rows of the `<epiparam>`

```{r convert-epiparam-epidist}
# find entry for COVID-19
epi_dist_covid <- epi_dist_db[which(epi_dist_db$disease == "COVID-19"), ]
epi_dist_covid <- epi_dist_db[epi_dist_db$disease == "COVID-19", ]
# find entry for COVID-19 incubation period
epi_dist_covid_incub <- epi_dist_covid[which(epi_dist_covid$epi_distribution == "incubation_period"), ] # nolint
epi_dist_covid_incub <- epi_dist_covid[epi_dist_covid$epi_distribution == "incubation_period", ] # nolint
# select one of the COVID-19 incubation period
covid_incub <- epi_dist_covid_incub[10, ]
Expand All @@ -111,7 +111,7 @@ covid_incub <- as_epidist(covid_incub)
covid_incub
```

The `<epidist>` object also has a custom printing method which shows the disease, pathogen (if known), the epidemiological distribution, a short citation of the study the parameters are from and the probability distribution and parameter of that distribution (if available).
The `<epidist>` object also has a custom printing method which shows the disease, pathogen (if known), the epidemiological distribution, a citation of the study the parameters are from and the probability distribution and parameter of that distribution (if available).

The opposite conversion from `<epidist>` to `<epiparam>` can also be achieved using `as_epiparam()`.

Expand Down
2 changes: 1 addition & 1 deletion vignettes/extract_convert.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ There are two conversion functions in {epiparameter}: `convert_params_to_summary

### Conversion functions

The conversion functions have two arguments. The first (`distribution`) defines which distribution you want to use and the second (`...`) lets you put as many named parameters or summary statistics as required. The arguments passed into `...` are matched name, and therefore need to match exactly to the names expected. See the function documentation (`?convert_params_to_summary_stats` and `?convert_summary_stats_to_params` for names).
The conversion functions have two arguments. The first (`distribution`) defines which distribution you want to use and the second (`...`) lets you put as many named parameters or summary statistics as required. The arguments passed into `...` are matched by name, and therefore need to match exactly to the names expected. See the function documentation (`?convert_params_to_summary_stats` and `?convert_summary_stats_to_params` for names).

All currently supported summary statistic conversions in {epiparameter} are given below for each distribution.

Expand Down

0 comments on commit 514a7e0

Please sign in to comment.