Skip to content

Commit

Permalink
Correct the R documentation #2712
Browse files Browse the repository at this point in the history
  • Loading branch information
iamleeg committed Jun 14, 2022
1 parent 0f87877 commit fcc8d83
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
2 changes: 0 additions & 2 deletions api/R/R/constants.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
FILTERS <- c("country")
DISEASE <- "covid-19"
ENVIRONMENT <- 'production'
downloadAsync <- "/api/cases/downloadAsync"
2 changes: 1 addition & 1 deletion api/R/R/get_cached_cases.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
get_cached_cases <-
function(apikey, disease = DISEASE, environment = ENVIRONMENT, refresh = FALSE, folder = "cache", ...) {
function(apikey, disease = 'covid-19', environment = 'production', refresh = FALSE, folder = "cache", ...) {
if(!file.exists(folder)) {
dir.create(folder)
}
Expand Down
2 changes: 1 addition & 1 deletion api/R/R/get_cases.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
get_cases <-
function(apikey, disease = DISEASE, environment = ENVIRONMENT, ...) {
function(apikey, disease = 'covid-19', environment = 'production', ...) {
server <- get_server(disease, environment)
data <- sprintf('{"format": "csv", "query": "%s"}', trimws(stringify_filters(...)))
res <- POST(paste0(server, downloadAsync), body = data,
Expand Down
5 changes: 4 additions & 1 deletion api/R/man/get_cached_cases.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Unless you always need to be working with the latest data, we recommend
using this function instead of \code{\link{get_cases}}.
}
\usage{
get_cached_cases(apikey, disease = 'covid-19', refresh = FALSE, folder = "cache", \dots)
get_cached_cases(apikey, disease = 'covid-19', environment = 'production', refresh = FALSE, folder = "cache", \dots)
}
\arguments{
\item{apikey}{
Expand All @@ -23,6 +23,9 @@ and clicking on Profile.
}
\item{disease}{
Identify the outbreak for which you want to fetch data; the default is COVID-19.
}
\item{environment}{
Specify the environment whose data you want to use: default is production, alternatives are dev or qa.
}
\item{refresh}{
Optional, if set to TRUE, refreshes the cache and returns the latest version of
Expand Down
5 changes: 4 additions & 1 deletion api/R/man/get_cases.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Unless you always need to be working with the latest data, we recommend
using \code{\link{get_cached_cases}} instead of this function.
}
\usage{
get_cases(apikey, disease = 'covid-19', \dots)
get_cases(apikey, disease = 'covid-19', environment = 'production', \dots)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
Expand All @@ -20,6 +20,9 @@ up at \url{https://data.covid-19.global.health} and clicking on Profile.
}
\item{disease}{
Identify the outbreak for which you want to fetch data; the default is COVID-19.
}
\item{environment}{
Specify the environment whose data you want to use: default is production, alternatives are dev or qa.
}
\item{\dots}{
Filters to use for data. Currently the only supported filter is 'country'
Expand Down

0 comments on commit fcc8d83

Please sign in to comment.