Skip to contents

Helper function to get options related to diseasy

Usage

diseasyoption(option, class = "DiseasystoreBase", .default = NULL)

Arguments

option

(character(1))
Name of the option to get.

class

(character(1) or R6::R6class Diseasy* instance)
Either the classname or the object the option applies to.

.default

(any)
The default value to return if no option is set.

Value

The most specific option within the diseasy framework for the given option and class

Examples

  # Retrieve default option for source conn
  diseasyoption("source_conn")
#> NULL

  # Retrieve DiseasystoreGoogleCovid19 specific option for source conn
  diseasyoption("source_conn", "DiseasystoreGoogleCovid19")
#> [1] "https://storage.googleapis.com/covid19-open-data/v3/"

  # Try to retrieve specific option for source conn for a non existent / un-configured diseasystore
  diseasyoption("source_conn", "DiseasystoreNonExistent") # Returns default source_conn
#> NULL

  # Try to retrieve specific non-existent option
  diseasyoption("non_existent", "DiseasystoreGoogleCovid19", .default = "Use this")
#> [1] "Use this"