get_cases | R Documentation |
A function to retrieve the case data for a
specific outbreak_id
.
get_cases(
url,
username,
password,
outbreak_id,
method = c("export", "batch"),
batch_size = 50000,
wait = 2,
file_type = c("json", "csv")
)
url |
Insert the base URL for your instance of Go.Data here. Don't forget the forward slash "/" at end! |
username |
The email address for your Go.Data login. |
password |
The password for your Go.Data login |
outbreak_id |
The id number for the outbreak for which you want to download data. |
method |
The method to download data. |
batch_size |
If |
wait |
If |
file_type |
If |
This function works on all versions of Go.Data. There are two methods for downloading the data:
method="batches"
will work on all versions of
Go.Data. This method relies on the GET outbreak/id/cases
API endpoint. Records are then retrieved in batches
based on batch_size
and appended together into
a final dataset. method = "batches"
will be the default and
only available method for Go.Data version 2.38.0 or older.
method="export"
will only work on Go.Data versions
2.38.1 or newer. This method relies on the GET
outbreak/id/cases/export API endpoint. An export
request is submitted to the server, and then when the
export is ready, it will be downloaded. Due to better
performance and more options, method = "export"
will
be the default if you are using Go.Data version 2.38.1
or newer.
Returns a data frame. Some fields, such as addresses, hospitalization
history, and questionnaire fields may require further unnesting. See
\link[tidyr]{nest}
for assitance with unnesting.
## Not run:
url <- "https://MyGoDataServer.com/"
username <- "myemail@email.com"
password <- "mypassword"
outbreak_id <- "3b5554d7-2c19-41d0-b9af-475ad25a382b"
cases <- get_cases(
url = url,
username = username,
password = password,
outbreak_id = outbreak_id
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.