Skip to content

Commit 6a74941

Browse files
committed
docs: document (GHA)
1 parent 7c67a30 commit 6a74941

File tree

2 files changed

+227
-222
lines changed

2 files changed

+227
-222
lines changed

README.md

+29-24
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
<!-- README.md is generated from README.Rmd. Please edit that file -->
23

34
# epiprocess
@@ -12,26 +13,26 @@ time series analysis and forecasting.
1213

1314
`{epiprocess}` contains:
1415

15-
- `epi_df()` and `epi_archive()`, two data frame classes (that work
16-
like a `{tibble}` with `{dplyr}` verbs) for working with
17-
epidemiological time series data;
18-
- signal processing tools building on these data structures such as
19-
- `epi_slide()` for sliding window operations;
20-
- `epix_slide()` for sliding window operations on archives;
21-
- `growth_rate()` for computing growth rates;
22-
- `detect_outlr()` for outlier detection;
23-
- `epi_cor()` for computing correlations;
16+
- `epi_df()` and `epi_archive()`, two data frame classes (that work
17+
like a `{tibble}` with `{dplyr}` verbs) for working with
18+
epidemiological time series data;
19+
- signal processing tools building on these data structures such as
20+
- `epi_slide()` for sliding window operations;
21+
- `epix_slide()` for sliding window operations on archives;
22+
- `growth_rate()` for computing growth rates;
23+
- `detect_outlr()` for outlier detection;
24+
- `epi_cor()` for computing correlations;
2425

2526
If you are new to this set of tools, you may be interested learning
2627
through a book format: [Introduction to Epidemiological
2728
Forecasting](https://cmu-delphi.github.io/delphi-tooling-book/).
2829

2930
You may also be interested in:
3031

31-
- `{epidatr}`, for accessing wide range of epidemiological data sets,
32-
including COVID-19 data, flu data, and more.
33-
- `{rtestim}`, a package for estimating the time-varying reproduction
34-
number of an epidemic.
32+
- `{epidatr}`, for accessing wide range of epidemiological data sets,
33+
including COVID-19 data, flu data, and more.
34+
- `{rtestim}`, a package for estimating the time-varying reproduction
35+
number of an epidemic.
3536

3637
This package is provided by the [Delphi group](https://delphi.cmu.edu/)
3738
at Carnegie Mellon University.
@@ -40,7 +41,7 @@ at Carnegie Mellon University.
4041

4142
To install:
4243

43-
```r
44+
``` r
4445
# Stable version
4546
pak::pkg_install("cmu-delphi/epiprocess@main")
4647

@@ -55,7 +56,7 @@ The package is not yet on CRAN.
5556
Once `epiprocess` and `epidatr` are installed, you can use the following
5657
code to get started:
5758

58-
```r
59+
``` r
5960
library(epiprocess)
6061
library(epidatr)
6162
library(dplyr)
@@ -66,7 +67,7 @@ Get COVID-19 confirmed cumulative case data from JHU CSSE for
6667
California, Florida, New York, and Texas, from March 1, 2020 to January
6768
31, 2022
6869

69-
```r
70+
``` r
7071
df <- pub_covidcast(
7172
source = "jhu-csse",
7273
signals = "confirmed_cumulative_num",
@@ -89,11 +90,11 @@ df
8990
#> # ℹ 2,802 more rows
9091
```
9192

92-
Convert the data to an epi_df object and sort by geo_value and
93-
time_value. You can work with an `epi_df` like you can with a
93+
Convert the data to an epi\_df object and sort by geo\_value and
94+
time\_value. You can work with an `epi_df` like you can with a
9495
`{tibble}` by using `{dplyr}` verbs
9596

96-
```r
97+
``` r
9798
edf <- df %>%
9899
as_epi_df() %>%
99100
arrange_canonical() %>%
@@ -103,8 +104,8 @@ edf
103104
#> An `epi_df` object, 2,808 x 4 with metadata:
104105
#> * geo_type = state
105106
#> * time_type = day
106-
#> * as_of = 2024-10-14 16:29:54.397851
107-
#>
107+
#> * as_of = 2024-10-15 02:26:30.787809
108+
#>
108109
#> # A tibble: 2,808 × 4
109110
#> # Groups: geo_value [4]
110111
#> geo_value time_value cases_cumulative cases_daily
@@ -119,16 +120,20 @@ edf
119120
```
120121

121122
Compute the 7 day moving average of the confirmed daily cases for each
122-
geo_value
123+
geo\_value
123124

124-
````r
125+
``` r
125126
edf <- edf %>%
126127
group_by(geo_value) %>%
128+
epi_slide_mean(cases_daily, .window_size = 7, na.rm = TRUE) %>%
129+
rename(smoothed_cases_daily = slide_value_cases_daily)
130+
```
131+
127132
Autoplot the confirmed daily cases for each geo\_value
128133

129134
``` r
130135
edf %>%
131136
autoplot(smoothed_cases_daily)
132-
````
137+
```
133138

134139
<img src="man/figures/README-unnamed-chunk-7-1.svg" width="90%" style="display: block; margin: auto;" />

0 commit comments

Comments
 (0)