export_downloader: Function to manage export downloads

View source: R/export_downloader.R

export_downloaderR Documentation

Function to manage export downloads

Description

A housekeeping function to do export requests & downloads.

Usage

export_downloader(url, username, password, api_call_request, wait, file_type)

Arguments

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

api_call_request

The API url to get the number of records.

wait

The number of seconds to wait in between iterations of checking the status of the export.

file_type

Whether the resulting data frame should contain nested fields (file_type = "json", the default) or an entirely flat data structure (file_type = "csv")

Value

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.

Examples

## 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)

WorldHealthOrganization/godataR documentation built on May 21, 2023, 11:30 a.m.