Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ Description: Provide helper functions for package developers to create
are downloaded from remote sources.
License: MIT + file LICENSE
Suggests:
testthat (>= 3.0.0)
testthat (>= 3.0.0),
fitZroy
Config/testthat/edition: 3
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
Expand Down
36 changes: 29 additions & 7 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,19 @@ remotes::install_github("mitchelloharawild/roam")
```{r example, eval = FALSE}
library(roam)
bee <- new_roam(
"roam", "bee",
function()
"roam", "bee",
function() {
read.csv(
"https://raw.githubusercontent.com/mitchelloharawild/roam/main/demo/bee_colonies.csv"))
"https://raw.githubusercontent.com/mitchelloharawild/roam/main/demo/bee_colonies.csv"
)
}
)

roam_activate(bee)

head(bee)
#> The roam data object "bee" in package roam does not exist locally
#> Would you like to download and cache it? (Yes/no/cancel)
#> Would you like to download and cache it? (Yes/no/cancel)
```

*The data is downloaded to a local cache using {rappdirs}, then returned as the data itself*
Expand All @@ -58,10 +61,13 @@ head(bee)
#| echo: false
library(roam)
bee <- new_roam(
"roam", "bee",
function()
"roam", "bee",
function() {
read.csv(
"https://raw.githubusercontent.com/mitchelloharawild/roam/master/demo/bee_colonies.csv"))
"https://raw.githubusercontent.com/mitchelloharawild/roam/master/demo/bee_colonies.csv"
)
}
)

roam_activate(bee)
roam_update(bee)
Expand Down Expand Up @@ -91,3 +97,19 @@ head(roam_update(bee))
roam_delete(bee)
```

You can even use other package's data.

```{r}
library(fitzRoy)

aflm_season_2020 <- new_roam(
"fitZroy", "aflm_season_2020",
function() {
fetch_fixture(season = 2020, comp = "AFLM")
}
)

roam_activate(aflm_season_2020)

aflm_season_2020
```
Loading