R/node.R
dc_get_statistical_variables.RdA convenience wrapper around dc_get_node() to retrieve all available
statistical variables in Data Commons. This is equivalent to calling
dc_get_node() with nodes = "StatisticalVariable" and
expression = "<-typeOf".
dc_get_statistical_variables(
api_key = Sys.getenv("DATACOMMONS_API_KEY"),
base_url = Sys.getenv("DATACOMMONS_BASE_URL", unset =
"https://api.datacommons.org/v2/"),
return_type = "json"
)Your Data Commons API key. If not provided, will use the
environment variable DATACOMMONS_API_KEY.
The base URL of the Data Commons API. Defaults to the public endpoint. For custom deployments, it must end with "/core/api/v2/".
Return format: either "list" (parsed R object) or
"json" (JSON string).
A list (if return_type = "list") or JSON string (if
return_type = "json") containing all available statistical variables.
# Get all statistical variables
statistical_vars <- dc_get_statistical_variables()