Learn R Programming

rmacrostrat (version 1.0.0)

GET_macrostrat: Fetch data from Macrostrat

Description

This function fetches data from Macrostrat via the Application Programming Interface (API). This is the core function for handling user requests.

Usage

GET_macrostrat(endpoint, query = list(), format = "json", output = "df")

Value

A data.frame (if format is "csv" or "json" and output is "df"), a list (if format is "json" and output is "list"), or sf object (if format is "geojson").

Arguments

endpoint

character. The API endpoint to retrieve data from Macrostrat.

query

character. The API query to retrieve data from Macrostrat.

format

character. The format that data should be downloaded in. Either: "csv", "json" (the default), or "geojson".

output

character. If format is "json", what format should the output be in? Valid options are "list" (the default) or "df" (data.frame). If "df" is chosen, all metadata will be lost.