get_data: Get data from dfe-api

Description Usage Arguments Details Value Examples

View source: R/get_data.R

Description

get_data The main function behind dfeAPI.

Usage

1
get_data(uri_string = NULL)

Arguments

uri_string

A properly formatted uri string with which to query the API. This would principally come from format_uri() and its relatives.

Details

Takes a properly formatted uri string as input, and makes a request of dfe-api, parses the returning JSON, and returns a list.

Value

A list containing the response, typically containing: ErrorMessage, NumberOfResults, Results, Taken, Skipped, Facets, QueryLat, QueryLong, Disambiguate, DisambiguationSuggestions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 

library(dfeAPI)
library(dplyr)

response <- "ks4" %>%
   format_uri %>%
   get_data

 # Convert to dplyr's data_frame (as data are very wide!)

 foo <- response$results %>%
   as_data_frame

   
## End(Not run)

ivyleavedtoadflax/dfeAPI documentation built on May 18, 2019, 7:13 a.m.