Requests to IntChron return JSON responses that are mapped to a complex nested list by jsonlite::fromJSON(). This convenience function provides access to specific named elements of those objects.

intchron_extract(x, what)

Arguments

x

List of IntChron records from intchron_request().

what

Element to extract: 'data_url', 'records', or 'file_data'.

Value

what from x.

See also

Other functions for interacting with the IntChron API: intchron_crawl(), intchron_request(), intchron_tabulate(), intchron_url()

Examples

khiv <- intchron_request(intchron_url("record", c("oxa", "nrcf"), "Jordan", "Kharaneh IV"))
intchron_extract(khiv, "data_url")
#> $`record/oxa/Jordan/Kharaneh IV`
#> [1] "https://c14.arch.ox.ac.uk/database/public.php?record=Jordan/Kharaneh+IV"
#> 
#> $`record/nrcf/Jordan/Kharaneh IV`
#> [1] "https://c14.arch.ox.ac.uk/database/public.php?record=Jordan/Kharaneh+IV"
#>