Skip to content

Commit

Permalink
Add example data
Browse files Browse the repository at this point in the history
  • Loading branch information
Bisaloo committed Jul 23, 2024
1 parent 0b338b7 commit e81d362
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
^docs$
^pkgdown$
^tools$
^data-raw$
3 changes: 3 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ Encoding: UTF-8
Language: en-GB
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
Depends:
R (>= 3.5)
LazyData: true
17 changes: 17 additions & 0 deletions authoritative.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
31 changes: 31 additions & 0 deletions data-raw/cran_epidemiology_packages.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
tf <- tempfile(fileext = ".md")
# Default branch name can change between repos so we check first
ctv_file_address <- gh::gh(
"/repos/{owner}/{repo}/contents/{path}",
owner = "cran-task-views",
repo = "Epidemiology",
path = "Epidemiology"
)
download.file(
ctv_file_address$download_url,
tf
)

ctv_pkgs <- ctv::read.ctv(tf) |>
purrr::pluck("packagelist", "name")

cran_epidemiology_packages <- ctv_pkgs |>
purrr::map(pkgsearch::cran_package_history)

cran_epidemiology_packages <- cran_epidemiology_packages |>
dplyr::select(
Package,
Version,
`Authors@R`,
Author,
Maintainer
)

rownames(cran_epidemiology_packages) <- NULL

usethis::use_data(cran_epidemiology_packages, overwrite = TRUE, version = 3)
Binary file added data/cran_epidemiology_packages.rda
Binary file not shown.

0 comments on commit e81d362

Please sign in to comment.