Skip to content

Commit

Permalink
add basic content to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
elray1 committed Apr 27, 2024
1 parent 6346986 commit e44f348
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 9 deletions.
24 changes: 19 additions & 5 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ knitr::opts_chunk$set(
[![R-CMD-check](https://github.com/Infectious-Disease-Modeling-Hubs/hubExamples/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/Infectious-Disease-Modeling-Hubs/hubExamples/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

The goal of hubExamples is to ...
The goal of hubExamples is to provide example data for forecasting and scenario modeling hubs in the hubverse format.

This package is part of the [hubverse](https://hubdocs.readthedocs.io/en/latest/) ecosystem, which aims to provide a set of tools for infectious disease modeling hubs to share and collaborate on their work.

Expand All @@ -35,13 +35,27 @@ You can install the development version of hubExamples from [GitHub](https://git
remotes::install_github("Infectious-Disease-Modeling-Hubs/hubExamples")
```

## Example
## Example forecast hub data

This is a basic example which shows you how to solve a common problem:
The package provides three data sets that contain example model output and
target data for an example forecast hub: `forecast_outputs`, `forecast_target_ts`, and
`forecast_target_observations`. Please see the package documentation for further information about these data objects.

```{r example}
```{r forecast_example}
library(hubExamples)
## basic example code
head(forecast_outputs)
head(forecast_target_ts)
head(forecast_target_observations)
```

## Example scenario hub data

The package provides two data sets that contain example model output and
target data for an example scenario hub: `scenario_outputs` and `scenario_target_ts`. Please see the package documentation for further information about these data objects.

```{r scenario_example}
head(scenario_outputs)
head(scenario_target_ts)
```

***
Expand Down
82 changes: 78 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ status](https://www.r-pkg.org/badges/version/hubExamples)](https://CRAN.R-projec
[![R-CMD-check](https://github.com/Infectious-Disease-Modeling-Hubs/hubExamples/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/Infectious-Disease-Modeling-Hubs/hubExamples/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

The goal of hubExamples is to …
The goal of hubExamples is to provide example data for forecasting and
scenario modeling hubs in the hubverse format.

This package is part of the
[hubverse](https://hubdocs.readthedocs.io/en/latest/) ecosystem, which
Expand All @@ -29,13 +30,86 @@ You can install the development version of hubExamples from
remotes::install_github("Infectious-Disease-Modeling-Hubs/hubExamples")
```

## Example
## Example forecast hub data

This is a basic example which shows you how to solve a common problem:
The package provides three data sets that contain example model output
and target data for an example forecast hub: `forecast_outputs`,
`forecast_target_ts`, and `forecast_target_observations`. Please see the
package documentation for further information about these data objects.

``` r
library(hubExamples)
## basic example code
head(forecast_outputs)
#> model_id location reference_date horizon target_end_date
#> 1 Flusight-baseline 48 2022-12-17 0 2022-12-17
#> 2 Flusight-baseline 48 2022-12-17 0 2022-12-17
#> 3 Flusight-baseline 48 2022-12-17 0 2022-12-17
#> 4 Flusight-baseline 48 2022-12-17 0 2022-12-17
#> 5 Flusight-baseline 48 2022-12-17 0 2022-12-17
#> 6 Flusight-baseline 48 2022-12-17 0 2022-12-17
#> target output_type output_type_id value
#> 1 wk flu hosp rate cdf 0.25 7.592233e-13
#> 2 wk flu hosp rate cdf 0.5 4.736251e-12
#> 3 wk flu hosp rate cdf 0.75 2.767176e-11
#> 4 wk flu hosp rate cdf 1 1.514312e-10
#> 5 wk flu hosp rate cdf 1.25 7.762725e-10
#> 6 wk flu hosp rate cdf 1.5 3.728055e-09
head(forecast_target_ts)
#> date location observation
#> 1 2020-01-11 01 0
#> 2 2020-01-11 15 0
#> 3 2020-01-11 18 0
#> 4 2020-01-11 27 0
#> 5 2020-01-11 30 0
#> 6 2020-01-11 37 0
head(forecast_target_observations)
#> location target_end_date target output_type output_type_id
#> 1 US 2022-10-22 wk inc flu hosp quantile <NA>
#> 2 01 2022-10-22 wk inc flu hosp quantile <NA>
#> 3 02 2022-10-22 wk inc flu hosp quantile <NA>
#> 4 04 2022-10-22 wk inc flu hosp quantile <NA>
#> 5 05 2022-10-22 wk inc flu hosp quantile <NA>
#> 6 06 2022-10-22 wk inc flu hosp quantile <NA>
#> observation
#> 1 2380
#> 2 141
#> 3 3
#> 4 22
#> 5 50
#> 6 124
```

## Example scenario hub data

The package provides two data sets that contain example model output and
target data for an example scenario hub: `scenario_outputs` and
`scenario_target_ts`. Please see the package documentation for further
information about these data objects.

``` r
head(scenario_outputs)
#> model_id origin_date scenario_id location target horizon
#> 1 HUBuni-simexamp 2021-03-07 A-2021-03-05 US inc case 1
#> 2 HUBuni-simexamp 2021-03-07 A-2021-03-05 US inc case 1
#> 3 HUBuni-simexamp 2021-03-07 A-2021-03-05 US inc case 1
#> 4 HUBuni-simexamp 2021-03-07 A-2021-03-05 US inc case 1
#> 5 HUBuni-simexamp 2021-03-07 A-2021-03-05 US inc case 1
#> 6 HUBuni-simexamp 2021-03-07 A-2021-03-05 US inc case 1
#> output_type output_type_id value
#> 1 quantile 0.010 292495.9
#> 2 quantile 0.025 308584.4
#> 3 quantile 0.050 312990.6
#> 4 quantile 0.100 327375.0
#> 5 quantile 0.150 337199.4
#> 6 quantile 0.200 345255.6
head(scenario_target_ts)
#> location date observation target
#> 1 US 2020-10-03 300678 inc case
#> 2 US 2020-10-10 334493 inc case
#> 3 US 2020-10-17 388282 inc case
#> 4 US 2020-10-24 484422 inc case
#> 5 US 2020-10-31 571389 inc case
#> 6 US 2020-11-07 776479 inc case
```

------------------------------------------------------------------------
Expand Down

0 comments on commit e44f348

Please sign in to comment.