From 7dc9eb67a3530cc027e66d3ccc7e31003cd7f536 Mon Sep 17 00:00:00 2001 From: boB Rudis Date: Wed, 29 May 2019 08:18:00 -0400 Subject: [PATCH] initial commit --- .Rbuildignore | 1 + DESCRIPTION | 9 +- LICENSE | 2 + LICENSE.md | 21 +++ NAMESPACE | 23 +++ R/aaa.R | 77 ++++++++ R/delphi-articles.R | 23 +++ R/delphi-cities.R | 28 +++ R/delphi-regions.R | 9 + R/delphi-states.R | 11 ++ R/delphiepidata-package.R | 14 +- R/f.R | 457 ++++++++++++++++++++++++++++++++++++++++++++++ README.Rmd | 31 +++- README.md | 77 ++++++++ man/cdc.Rd | 18 ++ man/delphi.Rd | 16 ++ man/delphi_articles.Rd | 14 ++ man/delphi_regions.Rd | 14 ++ man/delphi_states.Rd | 14 ++ man/delphiepidata.Rd | 11 +- man/dengue_nowcast.Rd | 16 ++ man/dengue_sensors.Rd | 20 ++ man/deplhi_cities.Rd | 14 ++ man/flusurv.Rd | 20 ++ man/fluview.Rd | 22 +++ man/fluview_clinical.Rd | 20 ++ man/gft.Rd | 16 ++ man/ght.Rd | 20 ++ man/meta.Rd | 11 ++ man/meta_norostat.Rd | 14 ++ man/nidss_dengue.Rd | 16 ++ man/nidss_flu.Rd | 20 ++ man/norostat.Rd | 18 ++ man/nowcast.Rd | 16 ++ man/quidel.Rd | 18 ++ man/sensors.Rd | 20 ++ man/twitter.Rd | 20 ++ man/wiki.Rd | 20 ++ 38 files changed, 1183 insertions(+), 8 deletions(-) create mode 100644 LICENSE create mode 100644 LICENSE.md create mode 100644 R/aaa.R create mode 100644 R/delphi-articles.R create mode 100644 R/delphi-cities.R create mode 100644 R/delphi-regions.R create mode 100644 R/delphi-states.R create mode 100644 R/f.R create mode 100644 man/cdc.Rd create mode 100644 man/delphi.Rd create mode 100644 man/delphi_articles.Rd create mode 100644 man/delphi_regions.Rd create mode 100644 man/delphi_states.Rd create mode 100644 man/dengue_nowcast.Rd create mode 100644 man/dengue_sensors.Rd create mode 100644 man/deplhi_cities.Rd create mode 100644 man/flusurv.Rd create mode 100644 man/fluview.Rd create mode 100644 man/fluview_clinical.Rd create mode 100644 man/gft.Rd create mode 100644 man/ght.Rd create mode 100644 man/meta.Rd create mode 100644 man/meta_norostat.Rd create mode 100644 man/nidss_dengue.Rd create mode 100644 man/nidss_flu.Rd create mode 100644 man/norostat.Rd create mode 100644 man/nowcast.Rd create mode 100644 man/quidel.Rd create mode 100644 man/sensors.Rd create mode 100644 man/twitter.Rd create mode 100644 man/wiki.Rd diff --git a/.Rbuildignore b/.Rbuildignore index ece4c73..29af0dd 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -13,3 +13,4 @@ ^tmp$ ^notes$ ^\.gitlab-ci\.yml$ +^LICENSE\.md$ diff --git a/DESCRIPTION b/DESCRIPTION index 68eb242..04766ae 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: delphiepidata Type: Package -Title: delphiepidata title goes here otherwise CRAN checks fail +Title: Query the 'CMU' 'DELPHI' Epidemiological Data 'API' Version: 0.1.0 Date: 2019-05-29 Authors@R: c( @@ -8,11 +8,14 @@ Authors@R: c( comment = c(ORCID = "0000-0001-5670-2640")) ) Maintainer: Bob Rudis -Description: A good description goes here otherwise CRAN checks fail. +Description: The 'CMU' 'DELPHI' () service + provides an aggregated, central point of access to influenza-like + illness ('ILI') related data sources. Methods are provided to query + all supported endpoints. URL: https://gitlab.com/hrbrmstr/delphiepidata BugReports: https://gitlab.com/hrbrmstr/delphiepidata/issues Encoding: UTF-8 -License: AGPL +License: MIT + file LICENSE Suggests: testthat, covr diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b6a10f1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,2 @@ +YEAR: 2019 +COPYRIGHT HOLDER: Bob Rudis diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..c36552c --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +# MIT License + +Copyright (c) 2019 Bob Rudis + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/NAMESPACE b/NAMESPACE index 5b4b9ae..27be860 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,4 +1,27 @@ # Generated by roxygen2: do not edit by hand +export(cdc) +export(delphi) +export(delphi_articles) +export(delphi_regions) +export(delphi_states) +export(dengue_nowcast) +export(dengue_sensors) +export(deplhi_cities) +export(flusurv) +export(fluview) +export(fluview_clinical) +export(gft) +export(ght) +export(meta) +export(meta_norostat) +export(nidss_dengue) +export(nidss_flu) +export(norostat) +export(nowcast) +export(quidel) +export(sensors) +export(twitter) +export(wiki) import(httr) importFrom(jsonlite,fromJSON) diff --git a/R/aaa.R b/R/aaa.R new file mode 100644 index 0000000..4dde2f5 --- /dev/null +++ b/R/aaa.R @@ -0,0 +1,77 @@ +httr::user_agent( + sprintf( + "delphiepidata package v%s: (<%s>)", + utils::packageVersion("delphiepidata"), + utils::packageDescription("delphiepidata")$URL + ) +) -> .DELPHI_UA + +# A module for DELPHI's Epidata API. +# +# https://github.com/cmu-delphi/delphi-epidata + +# API base url +BASE_URL <- 'https://delphi.midas.cs.cmu.edu/epidata/api.php' + +# Helper function to cast values and/or ranges to strings +.listitem <- function(value) { + + if(is.list(value) && 'from' %in% names(value) && 'to' %in% names(value)) { + return(paste0(toString(value$from), '-', toString(value$to))) + } else { + return(toString(value)) + } + +} + +# Helper function to build a list of values and/or ranges +.list <- function(values) { + + if(!is.list(values) || ('from' %in% names(values) && 'to' %in% names(values))) { + values <- list(values) + } + + return( + + paste( + vapply(values, .listitem, character(1)), + # sapply(values, .listitem), + collapse = ',' + ) + + ) + +} + +# Helper function to request and parse epidata +.request <- function(params) { + # API call + return( + httr::content( + httr::GET( + url = BASE_URL, + query = params, + .DELPHI_UA + ), + as = 'parsed' + ) + ) +} + +# Build a `range` object (ex: dates/epiweeks) +range <- function(from, to) { + + if(to <= from) { + temp <- to + to <- from + from <- temp + } + + return( + list( + from = from, + to = to + ) + ) + +} diff --git a/R/delphi-articles.R b/R/delphi-articles.R new file mode 100644 index 0000000..c8315dc --- /dev/null +++ b/R/delphi-articles.R @@ -0,0 +1,23 @@ +#' Supported Wikipedia Article Titles +#' +#' @docType data +#' @export +c( + 'amantadine', 'antiviral_drugs', 'avian_influenza', 'canine_influenza', + 'cat_flu', 'chills', 'common_cold', 'cough', 'equine_influenza', + 'fatigue_(medical)', 'fever', 'flu_season', 'gastroenteritis', + 'headache', 'hemagglutinin_(influenza)', 'human_flu', 'influenza', + 'influenzalike_illness', 'influenzavirus_a', 'influenzavirus_c', + 'influenza_a_virus', 'influenza_a_virus_subtype_h10n7', + 'influenza_a_virus_subtype_h1n1', 'influenza_a_virus_subtype_h1n2', + 'influenza_a_virus_subtype_h2n2', 'influenza_a_virus_subtype_h3n2', + 'influenza_a_virus_subtype_h3n8', 'influenza_a_virus_subtype_h5n1', + 'influenza_a_virus_subtype_h7n2', 'influenza_a_virus_subtype_h7n3', + 'influenza_a_virus_subtype_h7n7', 'influenza_a_virus_subtype_h7n9', + 'influenza_a_virus_subtype_h9n2', 'influenza_b_virus', 'influenza_pandemic', + 'influenza_prevention', 'influenza_vaccine', 'malaise', 'myalgia', + 'nasal_congestion', 'nausea', 'neuraminidase_inhibitor', 'orthomyxoviridae', + 'oseltamivir', 'paracetamol', 'rhinorrhea', 'rimantadine', 'shivering', + 'sore_throat', 'swine_influenza', 'viral_neuraminidase', 'viral_pneumonia', + 'vomiting', 'zanamivir' +) -> delphi_articles \ No newline at end of file diff --git a/R/delphi-cities.R b/R/delphi-cities.R new file mode 100644 index 0000000..78a14a1 --- /dev/null +++ b/R/delphi-cities.R @@ -0,0 +1,28 @@ +#' Supported Cities +#' +#' @docType data +#' @export +c( + 'Albany_NY', 'Albuquerque_NM', 'Anchorage_AK', 'Arlington_VA', + 'Atlanta_GA', 'Austin_TX', 'Baltimore_MD', 'Baton_Rouge_LA', + 'Beaverton_OR', 'Bellevue_WA', 'Berkeley_CA', 'Birmingham_AL', + 'Boise_ID', 'Boston_MA', 'Buffalo_NY', 'Cary_NC', 'Charlotte_NC', + 'Chicago_IL', 'Cleveland_OH', 'Colorado_Springs_CO', 'Columbia_SC', + 'Columbus_OH', 'Dallas_TX', 'Dayton_OH', 'Denver_CO', 'Des_Moines_IA', + 'Durham_NC', 'Eugene_OR', 'Fresno_CA', 'Ft_Worth_TX', 'Gainesville_FL', + 'Grand_Rapids_MI', 'Greensboro_NC', 'Greenville_SC', 'Honolulu_HI', + 'Houston_TX', 'Indianapolis_IN', 'Irvine_CA', 'Irving_TX', + 'Jacksonville_FL', 'Jackson_MS', 'Kansas_City_MO', 'Knoxville_TN', + 'Las_Vegas_NV', 'Lexington_KY', 'Lincoln_NE', 'Little_Rock_AR', + 'Los_Angeles_CA', 'Lubbock_TX', 'Madison_WI', 'Memphis_TN', 'Mesa_AZ', + 'Miami_FL', 'Milwaukee_WI', 'Nashville_TN', 'Newark_NJ', 'New_Orleans_LA', + 'New_York_NY', 'Norfolk_VA', 'Oakland_CA', 'Oklahoma_City_OK', 'Omaha_NE', + 'Orlando_FL', 'Philadelphia_PA', 'Phoenix_AZ', 'Pittsburgh_PA', 'Plano_TX', + 'Portland_OR', 'Providence_RI', 'Raleigh_NC', 'Reno_NV', 'Reston_VA', + 'Richmond_VA', 'Rochester_NY', 'Roswell_GA', 'Sacramento_CA', + 'Salt_Lake_City_UT', 'Santa_Clara_CA', 'San_Antonio_TX', 'San_Diego_CA', + 'San_Francisco_CA', 'San_Jose_CA', 'Scottsdale_AZ', 'Seattle_WA', + 'Somerville_MA', 'Spokane_WA', 'Springfield_MO', 'State_College_PA', + 'St_Louis_MO', 'St_Paul_MN', 'Sunnyvale_CA', 'Tampa_FL', 'Tempe_AZ', + 'Tucson_AZ', 'Tulsa_OK', 'Washington_DC', 'Wichita_KS' +) -> deplhi_cities \ No newline at end of file diff --git a/R/delphi-regions.R b/R/delphi-regions.R new file mode 100644 index 0000000..155f94f --- /dev/null +++ b/R/delphi-regions.R @@ -0,0 +1,9 @@ +#' Supported Regions +#' +#' @docType data +#' @export +c( + 'nat', 'hhs1', 'hhs2', 'hhs3', 'hhs4', 'hhs5', 'hhs6', + 'hhs7', 'hhs8', 'hhs9', 'hhs10', 'cen1', 'cen2', 'cen3', + 'cen4', 'cen5', 'cen6', 'cen7', 'cen8', 'cen9' +) -> delphi_regions \ No newline at end of file diff --git a/R/delphi-states.R b/R/delphi-states.R new file mode 100644 index 0000000..5c151a7 --- /dev/null +++ b/R/delphi-states.R @@ -0,0 +1,11 @@ +#' Supported States +#' +#' @docType data +#' @export +c( + 'AK', 'AL', 'AR', 'AZ', 'CA', 'CO', 'CT', 'DC', 'DE', 'FL', + 'GA', 'HI', 'IA', 'ID', 'IL', 'IN', 'KS', 'KY', 'LA', 'MA', + 'MD', 'ME', 'MI', 'MN', 'MO', 'MS', 'MT', 'NC', 'ND', 'NE', + 'NH', 'NJ', 'NM', 'NV', 'NY', 'OH', 'OK', 'OR', 'PA', 'RI', + 'SC', 'SD', 'TN', 'TX', 'UT', 'VA', 'VT', 'WA', 'WI', 'WV', 'WY' +) -> delphi_states \ No newline at end of file diff --git a/R/delphiepidata-package.R b/R/delphiepidata-package.R index 5da668e..65aaae3 100644 --- a/R/delphiepidata-package.R +++ b/R/delphiepidata-package.R @@ -1,10 +1,18 @@ -#' ... -#' +#' Query the 'CMU' 'DELPHI' Epidemiological Data 'API' +#' +#' The 'CMU' 'DELPHI' () service +#' provides an aggregated, central point of access to influenza-like +#' illness ('ILI') related data sources. Methods are provided to query +#' all supported endpoints. +#' +#' - DELPHI API docs: +#' - DELPHI: #' - URL: #' - BugReports: -#' +#' #' @md #' @name delphiepidata +#' @keywords internal #' @docType package #' @author Bob Rudis (bob@@rud.is) #' @import httr diff --git a/R/f.R b/R/f.R new file mode 100644 index 0000000..6563c3f --- /dev/null +++ b/R/f.R @@ -0,0 +1,457 @@ +#' Fetch FluView data +#' +#' @param regions a `list` of [delphi_regions] +#' @param epiweeks a `list` of epiweeks (format for an epiweek is `YYYYWW`) +#' @param issues a `list` of epiweeks (format for an epiweek is `YYYYWW`) +#' @param lag a number of weeks +#' @param auth password for private imputed data +#' @export +fluview <- function(regions, epiweeks, issues, lag, auth) { + + # Check parameters + if(missing(regions) || missing(epiweeks)) { + stop('`regions` and `epiweeks` are both required') + } + + if(!missing(issues) && !missing(lag)) { + stop('`issues` and `lag` are mutually exclusive') + } + + # Set up request + params <- list( + source = 'fluview', + regions = .list(regions), + epiweeks = .list(epiweeks) + ) + + if (!missing(issues)) params$issues <- .list(issues) + + if (!missing(lag)) params$lag <- lag + + if (!missing(auth)) params$auth <- auth + + # Make the API call + return(.request(params)) + +} + +#' Fetch FluView virological data +#' +#' @param regions a `list` of [delphi_regions] +#' @param epiweeks a `list` of epiweeks (format for an epiweek is `YYYYWW`) +#' @param issues a `list` of epiweeks (format for an epiweek is `YYYYWW`) +#' @param lag a number of weeks +#' @export +fluview_clinical <- function(regions, epiweeks, issues, lag) { + # Check parameters + if(missing(regions) || missing(epiweeks)) { + stop('`regions` and `epiweeks` are both required') + } + if(!missing(issues) && !missing(lag)) { + stop('`issues` and `lag` are mutually exclusive') + } + # Set up request + params <- list( + source = 'fluview_clinical', + regions = .list(regions), + epiweeks = .list(epiweeks) + ) + if(!missing(issues)) { + params$issues <- .list(issues) + } + if(!missing(lag)) { + params$lag <- lag + } + # Make the API call + return(.request(params)) +} + +#' Fetch FluSurv data +#' +#' @param locations a `list` of [delphi_regions] and/or [dephi_states] +#' @param epiweeks a `list` of epiweeks (format for an epiweek is `YYYYWW`) +#' @param issues a `list` of epiweeks (format for an epiweek is `YYYYWW`) +#' @param lag a number of weeks +#' @export +flusurv <- function(locations, epiweeks, issues, lag) { + # Check parameters + if(missing(locations) || missing(epiweeks)) { + stop('`locations` and `epiweeks` are both required') + } + if(!missing(issues) && !missing(lag)) { + stop('`issues` and `lag` are mutually exclusive') + } + # Set up request + params <- list( + source = 'flusurv', + locations = .list(locations), + epiweeks = .list(epiweeks) + ) + if(!missing(issues)) { + params$issues <- .list(issues) + } + if(!missing(lag)) { + params$lag <- lag + } + # Make the API call + return(.request(params)) +} + +#' Fetch Google Flu Trends data +#' +#' @param locations a `list` of [delphi_regions], [dephi_states], and/or [delphi_cities] +#' @param epiweeks a `list` of epiweeks (format for an epiweek is `YYYYWW`) +#' @export +gft <- function(locations, epiweeks) { + # Check parameters + if(missing(locations) || missing(epiweeks)) { + stop('`locations` and `epiweeks` are both required') + } + # Set up request + params <- list( + source = 'gft', + locations = .list(locations), + epiweeks = .list(epiweeks) + ) + # Make the API call + return(.request(params)) +} + +#' Fetch Google Health Trends data +#' +#' @param auth authentication token +#' @param locations a `list` of [delphi_regions] and/or [delphi_cities] +#' @param epiweeks a `list` of epiweeks (format for an epiweek is `YYYYWW`) +#' @param query google query +#' @export +ght <- function(auth, locations, epiweeks, query) { + # Check parameters + if(missing(auth) || missing(locations) || missing(epiweeks) || missing(query)) { + stop('`auth`, `locations`, `epiweeks`, and `query` are all required') + } + # Set up request + params <- list( + source = 'ght', + auth = auth, + locations = .list(locations), + epiweeks = .list(epiweeks), + query = query + ) + # Make the API call + return(.request(params)) +} + +#' Fetch HealthTweets data +#' +#' @param auth twitter auth token +#' @param locations a `list` of [delphi_regions] and/or [delphi_cities] +#' @param dates a `list` of dates (`YYYYMMDD` format) +#' @param epiweeks a `list` of epiweeks (format for an epiweek is `YYYYWW`) +#' @export +twitter <- function(auth, locations, dates, epiweeks) { + # Check parameters + if(missing(auth) || missing(locations)) { + stop('`auth` and `locations` are both required') + } + if(!xor(missing(dates), missing(epiweeks))) { + stop('exactly one of `dates` and `epiweeks` is required') + } + # Set up request + params <- list( + source = 'twitter', + auth = auth, + locations = .list(locations) + ) + if(!missing(dates)) { + params$dates <- .list(dates) + } + if(!missing(epiweeks)) { + params$epiweeks <- .list(epiweeks) + } + # Make the API call + return(.request(params)) +} + +#' Fetch Wikipedia access data +#' +#' @param articles a `list` of [delphi_articles] +#' @param dates a `list` of dates (`YYYYMMDD` format) +#' @param epiweeks a `list` of epiweeks (format for an epiweek is `YYYYWW`) +#' @param hours a `list` of hours +#' @export +wiki <- function(articles, dates, epiweeks, hours) { + # Check parameters + if(missing(articles)) { + stop('`articles` is required') + } + if(!xor(missing(dates), missing(epiweeks))) { + stop('exactly one of `dates` and `epiweeks` is required') + } + # Set up request + params <- list( + source = 'wiki', + articles = .list(articles) + ) + if(!missing(dates)) { + params$dates <- .list(dates) + } + if(!missing(epiweeks)) { + params$epiweeks <- .list(epiweeks) + } + if(!missing(hours)) { + params$hours <- .list(hours) + } + # Make the API call + return(.request(params)) +} + +#' Fetch CDC page hits +#' +#' @param auth auth token +#' @param epiweeks a `list` of epiweeks (format for an epiweek is `YYYYWW`) +#' @param locations a `list` of [delphi_regions] and/or [dephi_states] +#' @export +cdc <- function(auth, epiweeks, locations) { + # Check parameters + if(missing(auth) || missing(epiweeks) || missing(locations)) { + stop('`auth`, `epiweeks`, and `locations` are all required') + } + # Set up request + params <- list( + source = 'cdc', + auth = auth, + epiweeks = .list(epiweeks), + locations = .list(locations) + ) + # Make the API call + return(.request(params)) +} + +#' Fetch Quidel data +#' +#' @param auth auth token +#' @param epiweeks a `list` of epiweeks (format for an epiweek is `YYYYWW`) +#' @param locations a `list` of [delphi_regions] and/or [dephi_states] +#' @export +quidel <- function(auth, epiweeks, locations) { + # Check parameters + if(missing(auth) || missing(epiweeks) || missing(locations)) { + stop('`auth`, `epiweeks`, and `locations` are all required') + } + # Set up request + params <- list( + source = 'quidel', + auth = auth, + epiweeks = .list(epiweeks), + locations = .list(locations) + ) + # Make the API call + return(.request(params)) +} + +#' Fetch NoroSTAT data (point data, no min/max) +#' +#' @param auth auth token +#' @param location a single [delphi_regions] and/or [dephi_states] +#' @param epiweeks a `list` of epiweeks (format for an epiweek is `YYYYWW`) +#' @export +norostat <- function(auth, location, epiweeks) { + # Check parameters + if(missing(auth) || missing(location) || missing(epiweeks)) { + stop('`auth`, `location`, and `epiweeks` are all required') + } + # Set up request + params <- list( + source = 'norostat', + auth = auth, + location = location, + epiweeks = .list(epiweeks) + ) + # Make the API call + return(.request(params)) +} + +#' Fetch NoroSTAT metadata +#' +#' @param auth auth token +#' @export +meta_norostat <- function(auth) { + # Check parameters + if(missing(auth)) { + stop('`auth` is required') + } + # Set up request + params <- list( + source = 'meta_norostat', + auth = auth + ) + # Make the API call + return(.request(params)) +} + +#' Fetch NIDSS flu data +#' +#' @param regions a `list` of [delphi_regions] +#' @param epiweeks a `list` of epiweeks (format for an epiweek is `YYYYWW`) +#' @param issues a `list` of issues +#' @param lag a number of weeks +#' @export +nidss_flu <- function(regions, epiweeks, issues, lag) { + # Check parameters + if(missing(regions) || missing(epiweeks)) { + stop('`regions` and `epiweeks` are both required') + } + if(!missing(issues) && !missing(lag)) { + stop('`issues` and `lag` are mutually exclusive') + } + # Set up request + params <- list( + source = 'nidss_flu', + regions = .list(regions), + epiweeks = .list(epiweeks) + ) + if(!missing(issues)) { + params$issues <- .list(issues) + } + if(!missing(lag)) { + params$lag <- lag + } + # Make the API call + return(.request(params)) +} + +#' Fetch NIDSS dengue data +#' +#' @param locations a `list` of [delphi_regions] and/or [dephi_states] +#' @param epiweeks a `list` of epiweeks (format for an epiweek is `YYYYWW`) +#' @export +nidss_dengue <- function(locations, epiweeks) { + # Check parameters + if(missing(locations) || missing(epiweeks)) { + stop('`locations` and `epiweeks` are both required') + } + # Set up request + params <- list( + source = 'nidss_dengue', + locations = .list(locations), + epiweeks = .list(epiweeks) + ) + # Make the API call + return(.request(params)) +} + +#' Fetch Delphi's forecast +#' +#' @param system (not sure) +#' @param epiweek an epiweek (fomat `YYYYWW`) +#' @export +delphi <- function(system, epiweek) { + # Check parameters + if(missing(system) || missing(epiweek)) { + stop('`system` and `epiweek` are both required') + } + # Set up request + params <- list( + source = 'delphi', + system = system, + epiweek = epiweek + ) + # Make the API call + return(.request(params)) +} + +#' Fetch Delphi's digital surveillance sensors +#' +#' @param auth auth token +#' @param names sensor name? +#' @param locations a `list` of [delphi_regions] and/or [dephi_states] +#' @param epiweeks a `list` of epiweeks (format for an epiweek is `YYYYWW`) +#' @export +sensors <- function(auth, names, locations, epiweeks) { + # Check parameters + if(missing(auth) || missing(names) || missing(locations) || missing(epiweeks)) { + stop('`auth`, `names`, `locations`, and `epiweeks` are all required') + } + # Set up request + params <- list( + source = 'sensors', + auth = auth, + names = .list(names), + locations = .list(locations), + epiweeks = .list(epiweeks) + ) + # Make the API call + return(.request(params)) +} + +#' Fetch Delphi's digital surveillance sensors +#' +#' @param auth auth token +#' @param names sensor names? +#' @param locations a `list` of [delphi_regions] and/or [dephi_states] +#' @param epiweeks a `list` of epiweeks (format for an epiweek is `YYYYWW`) +#' @export +dengue_sensors <- function(auth, names, locations, epiweeks) { + # Check parameters + if(missing(auth) || missing(names) || missing(locations) || missing(epiweeks)) { + stop('`auth`, `names`, `locations`, and `epiweeks` are all required') + } + # Set up request + params <- list( + source = 'dengue_sensors', + auth = auth, + names = .list(names), + locations = .list(locations), + epiweeks = .list(epiweeks) + ) + # Make the API call + return(.request(params)) +} + +#' Fetch Delphi's wILI nowcast +#' +#' @param locations a `list` of [delphi_regions] and/or [dephi_states] +#' @param epiweeks a `list` of epiweeks (format for an epiweek is `YYYYWW`) +#' @export +nowcast <- function(locations, epiweeks) { + # Check parameters + if(missing(locations) || missing(epiweeks)) { + stop('`locations` and `epiweeks` are both required') + } + # Set up request + params <- list( + source = 'nowcast', + locations = .list(locations), + epiweeks = .list(epiweeks) + ) + # Make the API call + return(.request(params)) +} + +#' Fetch Delphi's PAHO Dengue nowcast +#' +#' @param locations a `list` of [delphi_regions] and/or [dephi_states] +#' @param epiweeks a `list` of epiweeks (format for an epiweek is `YYYYWW`) +#' @export +dengue_nowcast <- function(locations, epiweeks) { + # Check parameters + if(missing(locations) || missing(epiweeks)) { + stop('`locations` and `epiweeks` are both required') + } + # Set up request + params <- list( + source = 'dengue_nowcast', + locations = .list(locations), + epiweeks = .list(epiweeks) + ) + # Make the API call + return(.request(params)) +} + +#' Fetch API metadata +#' +#' @export +meta <- function() { + return(.request(list(source='meta'))) +} + diff --git a/README.Rmd b/README.Rmd index 888611c..8ad03e8 100644 --- a/README.Rmd +++ b/README.Rmd @@ -14,18 +14,47 @@ options(width=120) # delphiepidata +Query the 'CMU' 'DELPHI' Epidemiological Data 'API' + ## Description +The 'CMU' 'DELPHI' () service provides an aggregated, central point of access to influenza-like illness ('ILI') related data sources. Methods are provided to query all supported endpoints. + +- DELPHI API docs: +- DELPHI: +- URL: +- BugReports: + ## What's Inside The Tin The following functions are implemented: +- `cdc`: Fetch CDC page hits +- `delphi`: Fetch Delphi's forecast +- `dengue_nowcast`: Fetch Delphi's PAHO Dengue nowcast +- `dengue_sensors`: Fetch Delphi's digital surveillance sensors +- `flusurv`: Fetch FluSurv data +- `fluview`: Fetch FluView data +- `fluview_clinical`: Fetch FluView virological data +- `gft`: Fetch Google Flu Trends data +- `ght`: Fetch Google Health Trends data +- `meta`: Fetch API metadata +- `meta_norostat`: Fetch NoroSTAT metadata +- `nidss_dengue`: Fetch NIDSS dengue data +- `nidss_flu`: Fetch NIDSS flu data +- `norostat`: Fetch NoroSTAT data (point data, no min/max) +- `nowcast`: Fetch Delphi's wILI nowcast +- `quidel`: Fetch Quidel data +- `sensors`: Fetch Delphi's digital surveillance sensors +- `twitter`: Fetch HealthTweets data +- `wiki`: Fetch Wikipedia access data + ## Installation ```{r install-ex, eval=FALSE} devtools::install_git("https://sr.ht.com/~hrbrmstr/delphiepidata.git") # or -devtools::install_git("https://gitlab.com/hrbrmstr/delphiepidata.git") +devtools::install_gitlab("hrbrmstr/delphiepidata") # or (if you must) devtools::install_github("hrbrmstr/delphiepidata") ``` diff --git a/README.md b/README.md index 2a92eb9..9d788df 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,79 @@ + +[![Travis-CI Build +Status](https://travis-ci.org/hrbrmstr/delphiepidata.svg?branch=master)](https://travis-ci.org/hrbrmstr/delphiepidata) +[![Coverage +Status](https://codecov.io/gh/hrbrmstr/delphiepidata/branch/master/graph/badge.svg)](https://codecov.io/gh/hrbrmstr/delphiepidata) +[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/delphiepidata)](https://cran.r-project.org/package=delphiepidata) + # delphiepidata +Query the ‘CMU’ ‘DELPHI’ Epidemiological Data ‘API’ + +## Description + +The ‘CMU’ ‘DELPHI’ () service provides +an aggregated, central point of access to influenza-like illness (‘ILI’) +related data sources. Methods are provided to query all supported +endpoints. + + - DELPHI API docs: + - DELPHI: + - URL: + - BugReports: + +## What’s Inside The Tin + +The following functions are implemented: + + - `cdc`: Fetch CDC page hits + - `delphi`: Fetch Delphi’s forecast + - `dengue_nowcast`: Fetch Delphi’s PAHO Dengue nowcast + - `dengue_sensors`: Fetch Delphi’s digital surveillance sensors + - `flusurv`: Fetch FluSurv data + - `fluview`: Fetch FluView data + - `fluview_clinical`: Fetch FluView virological data + - `gft`: Fetch Google Flu Trends data + - `ght`: Fetch Google Health Trends data + - `meta`: Fetch API metadata + - `meta_norostat`: Fetch NoroSTAT metadata + - `nidss_dengue`: Fetch NIDSS dengue data + - `nidss_flu`: Fetch NIDSS flu data + - `norostat`: Fetch NoroSTAT data (point data, no min/max) + - `nowcast`: Fetch Delphi’s wILI nowcast + - `quidel`: Fetch Quidel data + - `sensors`: Fetch Delphi’s digital surveillance sensors + - `twitter`: Fetch HealthTweets data + - `wiki`: Fetch Wikipedia access data + +## Installation + +``` r +devtools::install_git("https://sr.ht.com/~hrbrmstr/delphiepidata.git") +# or +devtools::install_gitlab("hrbrmstr/delphiepidata") +# or (if you must) +devtools::install_github("hrbrmstr/delphiepidata") +``` + +## Usage + +``` r +library(delphiepidata) + +# current version +packageVersion("delphiepidata") +## [1] '0.1.0' +``` + +## delphiepidata Metrics + +| Lang | \# Files | (%) | LoC | (%) | Blank lines | (%) | \# Lines | (%) | +| :--- | -------: | --: | --: | ---: | ----------: | --: | -------: | ---: | +| R | 9 | 0.9 | 374 | 0.98 | 45 | 0.7 | 206 | 0.79 | +| Rmd | 1 | 0.1 | 8 | 0.02 | 19 | 0.3 | 54 | 0.21 | + +## Code of Conduct + +Please note that this project is released with a [Contributor Code of +Conduct](CONDUCT.md). By participating in this project you agree to +abide by its terms. diff --git a/man/cdc.Rd b/man/cdc.Rd new file mode 100644 index 0000000..09e083c --- /dev/null +++ b/man/cdc.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/f.R +\name{cdc} +\alias{cdc} +\title{Fetch CDC page hits} +\usage{ +cdc(auth, epiweeks, locations) +} +\arguments{ +\item{auth}{auth token} + +\item{epiweeks}{a \code{list} of epiweeks (format for an epiweek is \code{YYYYWW})} + +\item{locations}{a \code{list} of \link{delphi_regions} and/or \link{dephi_states}} +} +\description{ +Fetch CDC page hits +} diff --git a/man/delphi.Rd b/man/delphi.Rd new file mode 100644 index 0000000..06d9c1c --- /dev/null +++ b/man/delphi.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/f.R +\name{delphi} +\alias{delphi} +\title{Fetch Delphi's forecast} +\usage{ +delphi(system, epiweek) +} +\arguments{ +\item{system}{(not sure)} + +\item{epiweek}{an epiweek (fomat \code{YYYYWW})} +} +\description{ +Fetch Delphi's forecast +} diff --git a/man/delphi_articles.Rd b/man/delphi_articles.Rd new file mode 100644 index 0000000..3e2df69 --- /dev/null +++ b/man/delphi_articles.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/delphi-articles.R +\docType{data} +\name{delphi_articles} +\alias{delphi_articles} +\title{Supported Wikipedia Article Titles} +\format{An object of class \code{character} of length 54.} +\usage{ +delphi_articles +} +\description{ +Supported Wikipedia Article Titles +} +\keyword{datasets} diff --git a/man/delphi_regions.Rd b/man/delphi_regions.Rd new file mode 100644 index 0000000..6121c04 --- /dev/null +++ b/man/delphi_regions.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/delphi-regions.R +\docType{data} +\name{delphi_regions} +\alias{delphi_regions} +\title{Supported Regions} +\format{An object of class \code{character} of length 20.} +\usage{ +delphi_regions +} +\description{ +Supported Regions +} +\keyword{datasets} diff --git a/man/delphi_states.Rd b/man/delphi_states.Rd new file mode 100644 index 0000000..0dca9ad --- /dev/null +++ b/man/delphi_states.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/delphi-states.R +\docType{data} +\name{delphi_states} +\alias{delphi_states} +\title{Supported States} +\format{An object of class \code{character} of length 51.} +\usage{ +delphi_states +} +\description{ +Supported States +} +\keyword{datasets} diff --git a/man/delphiepidata.Rd b/man/delphiepidata.Rd index 14844f6..8589250 100644 --- a/man/delphiepidata.Rd +++ b/man/delphiepidata.Rd @@ -4,9 +4,17 @@ \name{delphiepidata} \alias{delphiepidata} \alias{delphiepidata-package} -\title{...} +\title{Query the 'CMU' 'DELPHI' Epidemiological Data 'API'} \description{ +The 'CMU' 'DELPHI' (\url{https://delphi.midas.cs.cmu.edu/}) service +provides an aggregated, central point of access to influenza-like +illness ('ILI') related data sources. Methods are provided to query +all supported endpoints. +} +\details{ \itemize{ +\item DELPHI API docs: \url{https://github.com/cmu-delphi/delphi-epidata} +\item DELPHI: \url{https://delphi.midas.cs.cmu.edu/} \item URL: \url{https://gitlab.com/hrbrmstr/delphiepidata} \item BugReports: \url{https://gitlab.com/hrbrmstr/delphiepidata/issues} } @@ -14,3 +22,4 @@ \author{ Bob Rudis (bob@rud.is) } +\keyword{internal} diff --git a/man/dengue_nowcast.Rd b/man/dengue_nowcast.Rd new file mode 100644 index 0000000..f41f5cd --- /dev/null +++ b/man/dengue_nowcast.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/f.R +\name{dengue_nowcast} +\alias{dengue_nowcast} +\title{Fetch Delphi's PAHO Dengue nowcast} +\usage{ +dengue_nowcast(locations, epiweeks) +} +\arguments{ +\item{locations}{a \code{list} of \link{delphi_regions} and/or \link{dephi_states}} + +\item{epiweeks}{a \code{list} of epiweeks (format for an epiweek is \code{YYYYWW})} +} +\description{ +Fetch Delphi's PAHO Dengue nowcast +} diff --git a/man/dengue_sensors.Rd b/man/dengue_sensors.Rd new file mode 100644 index 0000000..1f941a0 --- /dev/null +++ b/man/dengue_sensors.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/f.R +\name{dengue_sensors} +\alias{dengue_sensors} +\title{Fetch Delphi's digital surveillance sensors} +\usage{ +dengue_sensors(auth, names, locations, epiweeks) +} +\arguments{ +\item{auth}{auth token} + +\item{names}{sensor names?} + +\item{locations}{a \code{list} of \link{delphi_regions} and/or \link{dephi_states}} + +\item{epiweeks}{a \code{list} of epiweeks (format for an epiweek is \code{YYYYWW})} +} +\description{ +Fetch Delphi's digital surveillance sensors +} diff --git a/man/deplhi_cities.Rd b/man/deplhi_cities.Rd new file mode 100644 index 0000000..b3f022a --- /dev/null +++ b/man/deplhi_cities.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/delphi-cities.R +\docType{data} +\name{deplhi_cities} +\alias{deplhi_cities} +\title{Supported Cities} +\format{An object of class \code{character} of length 97.} +\usage{ +deplhi_cities +} +\description{ +Supported Cities +} +\keyword{datasets} diff --git a/man/flusurv.Rd b/man/flusurv.Rd new file mode 100644 index 0000000..06b3537 --- /dev/null +++ b/man/flusurv.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/f.R +\name{flusurv} +\alias{flusurv} +\title{Fetch FluSurv data} +\usage{ +flusurv(locations, epiweeks, issues, lag) +} +\arguments{ +\item{locations}{a \code{list} of \link{delphi_regions} and/or \link{dephi_states}} + +\item{epiweeks}{a \code{list} of epiweeks (format for an epiweek is \code{YYYYWW})} + +\item{issues}{a \code{list} of epiweeks (format for an epiweek is \code{YYYYWW})} + +\item{lag}{a number of weeks} +} +\description{ +Fetch FluSurv data +} diff --git a/man/fluview.Rd b/man/fluview.Rd new file mode 100644 index 0000000..ce1a120 --- /dev/null +++ b/man/fluview.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/f.R +\name{fluview} +\alias{fluview} +\title{Fetch FluView data} +\usage{ +fluview(regions, epiweeks, issues, lag, auth) +} +\arguments{ +\item{regions}{a \code{list} of \link{delphi_regions}} + +\item{epiweeks}{a \code{list} of epiweeks (format for an epiweek is \code{YYYYWW})} + +\item{issues}{a \code{list} of epiweeks (format for an epiweek is \code{YYYYWW})} + +\item{lag}{a number of weeks} + +\item{auth}{password for private imputed data} +} +\description{ +Fetch FluView data +} diff --git a/man/fluview_clinical.Rd b/man/fluview_clinical.Rd new file mode 100644 index 0000000..0f6de59 --- /dev/null +++ b/man/fluview_clinical.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/f.R +\name{fluview_clinical} +\alias{fluview_clinical} +\title{Fetch FluView virological data} +\usage{ +fluview_clinical(regions, epiweeks, issues, lag) +} +\arguments{ +\item{regions}{a \code{list} of \link{delphi_regions}} + +\item{epiweeks}{a \code{list} of epiweeks (format for an epiweek is \code{YYYYWW})} + +\item{issues}{a \code{list} of epiweeks (format for an epiweek is \code{YYYYWW})} + +\item{lag}{a number of weeks} +} +\description{ +Fetch FluView virological data +} diff --git a/man/gft.Rd b/man/gft.Rd new file mode 100644 index 0000000..bb6efe5 --- /dev/null +++ b/man/gft.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/f.R +\name{gft} +\alias{gft} +\title{Fetch Google Flu Trends data} +\usage{ +gft(locations, epiweeks) +} +\arguments{ +\item{locations}{a \code{list} of \link{delphi_regions}, \link{dephi_states}, and/or \link{delphi_cities}} + +\item{epiweeks}{a \code{list} of epiweeks (format for an epiweek is \code{YYYYWW})} +} +\description{ +Fetch Google Flu Trends data +} diff --git a/man/ght.Rd b/man/ght.Rd new file mode 100644 index 0000000..929fa8f --- /dev/null +++ b/man/ght.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/f.R +\name{ght} +\alias{ght} +\title{Fetch Google Health Trends data} +\usage{ +ght(auth, locations, epiweeks, query) +} +\arguments{ +\item{auth}{authentication token} + +\item{locations}{a \code{list} of \link{delphi_regions} and/or \link{delphi_cities}} + +\item{epiweeks}{a \code{list} of epiweeks (format for an epiweek is \code{YYYYWW})} + +\item{query}{google query} +} +\description{ +Fetch Google Health Trends data +} diff --git a/man/meta.Rd b/man/meta.Rd new file mode 100644 index 0000000..16a5eaf --- /dev/null +++ b/man/meta.Rd @@ -0,0 +1,11 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/f.R +\name{meta} +\alias{meta} +\title{Fetch API metadata} +\usage{ +meta() +} +\description{ +Fetch API metadata +} diff --git a/man/meta_norostat.Rd b/man/meta_norostat.Rd new file mode 100644 index 0000000..cfc86ff --- /dev/null +++ b/man/meta_norostat.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/f.R +\name{meta_norostat} +\alias{meta_norostat} +\title{Fetch NoroSTAT metadata} +\usage{ +meta_norostat(auth) +} +\arguments{ +\item{auth}{auth token} +} +\description{ +Fetch NoroSTAT metadata +} diff --git a/man/nidss_dengue.Rd b/man/nidss_dengue.Rd new file mode 100644 index 0000000..6eacda8 --- /dev/null +++ b/man/nidss_dengue.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/f.R +\name{nidss_dengue} +\alias{nidss_dengue} +\title{Fetch NIDSS dengue data} +\usage{ +nidss_dengue(locations, epiweeks) +} +\arguments{ +\item{locations}{a \code{list} of \link{delphi_regions} and/or \link{dephi_states}} + +\item{epiweeks}{a \code{list} of epiweeks (format for an epiweek is \code{YYYYWW})} +} +\description{ +Fetch NIDSS dengue data +} diff --git a/man/nidss_flu.Rd b/man/nidss_flu.Rd new file mode 100644 index 0000000..8185027 --- /dev/null +++ b/man/nidss_flu.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/f.R +\name{nidss_flu} +\alias{nidss_flu} +\title{Fetch NIDSS flu data} +\usage{ +nidss_flu(regions, epiweeks, issues, lag) +} +\arguments{ +\item{regions}{a \code{list} of \link{delphi_regions}} + +\item{epiweeks}{a \code{list} of epiweeks (format for an epiweek is \code{YYYYWW})} + +\item{issues}{a \code{list} of issues} + +\item{lag}{a number of weeks} +} +\description{ +Fetch NIDSS flu data +} diff --git a/man/norostat.Rd b/man/norostat.Rd new file mode 100644 index 0000000..a28d023 --- /dev/null +++ b/man/norostat.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/f.R +\name{norostat} +\alias{norostat} +\title{Fetch NoroSTAT data (point data, no min/max)} +\usage{ +norostat(auth, location, epiweeks) +} +\arguments{ +\item{auth}{auth token} + +\item{location}{a single \link{delphi_regions} and/or \link{dephi_states}} + +\item{epiweeks}{a \code{list} of epiweeks (format for an epiweek is \code{YYYYWW})} +} +\description{ +Fetch NoroSTAT data (point data, no min/max) +} diff --git a/man/nowcast.Rd b/man/nowcast.Rd new file mode 100644 index 0000000..b0fe2d7 --- /dev/null +++ b/man/nowcast.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/f.R +\name{nowcast} +\alias{nowcast} +\title{Fetch Delphi's wILI nowcast} +\usage{ +nowcast(locations, epiweeks) +} +\arguments{ +\item{locations}{a \code{list} of \link{delphi_regions} and/or \link{dephi_states}} + +\item{epiweeks}{a \code{list} of epiweeks (format for an epiweek is \code{YYYYWW})} +} +\description{ +Fetch Delphi's wILI nowcast +} diff --git a/man/quidel.Rd b/man/quidel.Rd new file mode 100644 index 0000000..fe77706 --- /dev/null +++ b/man/quidel.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/f.R +\name{quidel} +\alias{quidel} +\title{Fetch Quidel data} +\usage{ +quidel(auth, epiweeks, locations) +} +\arguments{ +\item{auth}{auth token} + +\item{epiweeks}{a \code{list} of epiweeks (format for an epiweek is \code{YYYYWW})} + +\item{locations}{a \code{list} of \link{delphi_regions} and/or \link{dephi_states}} +} +\description{ +Fetch Quidel data +} diff --git a/man/sensors.Rd b/man/sensors.Rd new file mode 100644 index 0000000..61baa92 --- /dev/null +++ b/man/sensors.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/f.R +\name{sensors} +\alias{sensors} +\title{Fetch Delphi's digital surveillance sensors} +\usage{ +sensors(auth, names, locations, epiweeks) +} +\arguments{ +\item{auth}{auth token} + +\item{names}{sensor name?} + +\item{locations}{a \code{list} of \link{delphi_regions} and/or \link{dephi_states}} + +\item{epiweeks}{a \code{list} of epiweeks (format for an epiweek is \code{YYYYWW})} +} +\description{ +Fetch Delphi's digital surveillance sensors +} diff --git a/man/twitter.Rd b/man/twitter.Rd new file mode 100644 index 0000000..b9d6996 --- /dev/null +++ b/man/twitter.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/f.R +\name{twitter} +\alias{twitter} +\title{Fetch HealthTweets data} +\usage{ +twitter(auth, locations, dates, epiweeks) +} +\arguments{ +\item{auth}{twitter auth token} + +\item{locations}{a \code{list} of \link{delphi_regions} and/or \link{delphi_cities}} + +\item{dates}{a \code{list} of dates (\code{YYYYMMDD} format)} + +\item{epiweeks}{a \code{list} of epiweeks (format for an epiweek is \code{YYYYWW})} +} +\description{ +Fetch HealthTweets data +} diff --git a/man/wiki.Rd b/man/wiki.Rd new file mode 100644 index 0000000..99e12f8 --- /dev/null +++ b/man/wiki.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/f.R +\name{wiki} +\alias{wiki} +\title{Fetch Wikipedia access data} +\usage{ +wiki(articles, dates, epiweeks, hours) +} +\arguments{ +\item{articles}{a \code{list} of \link{delphi_articles}} + +\item{dates}{a \code{list} of dates (\code{YYYYMMDD} format)} + +\item{epiweeks}{a \code{list} of epiweeks (format for an epiweek is \code{YYYYWW})} + +\item{hours}{a \code{list} of hours} +} +\description{ +Fetch Wikipedia access data +}