lol() constructs an indexed representation of an R
'list-of-lists', typically from JSON queries. The object is
conveniently manipulated by other functions on this page to
filter and select subsets of the structure, and to pull
individual paths from across the list-of-lists.
lol_filter() filters available paths based on
n (number of matching elements) or
is_leaf (is the element a 'leaf' in the list-of-lists
lol_lpull() returns a list containing elements
corresponding to a single
lol_pull() tries to simplify the list-of-lists
structure returned by
lol_lpull() to a vector.
lol_path() returns a tibble representing the paths
through the list-of-lists, without the underlying list-of-list
as.list() returns a list-of-lists representation of
the data returned by
hca_next() returns the next 'page' of results, if
hca_prev() returns the previous 'page' of results.
lol_hits_pull() are variants
lol_pull() that retain the original
hits[*], even when the mapping between
path is not 1:1.
lol(x = list()) lol_select(x, path = character()) lol_filter(x, ...) lol_lpull(x, path) lol_pull(x, path) lol_path(x) ## S3 method for class 'lol' as.list(x, ...) ## S3 method for class 'lol' print(x, ...) ## S3 method for class 'lol_hca' hca_next(x, size) ## S3 method for class 'lol_hca' hca_prev(x, size) lol_hits_lpull(x, path) lol_hits_pull(x, path)
a 'list-of-lists' returned by
character(1) from the tibble returned by
the (non-negative integer) number of elements to
retrieve in the page request. The default is the number of
elements requested in
lol() returns a representation of the list-of-lists. The
list has been processed to a dictionary with entries to all
paths through the list, as well as a tibble summarizing the
path, number of occurrences, and leaf status of each unique
lol_select() returns an object of class
to contain just the elements matching
path as 'top-level'
elements of the list-of-lists.
lol_filter() returns an object of class
to contain elements consistent with the filter criteria.
lol_lpull() returns a list, where each element
corresponds to an element found at
path in the list-of-lists
lol_pull() returns an unnamed vector of elements matching
hca_next() returns a list-of-lists containing the next
'page' of results.
hca_prev() returns a tibble with the same columns as
containing the previous 'page' of results.
plol <- projects(size = 5, as = "lol") plol plol |> lol_select("hits[*].projects[*]") plol |> lol_select("hits[*].projects[*]") |> lol_filter(n == 44, is_leaf) plol |> lol_pull("hits[*].entryId") |> head() plol |> lol_path() projects <- projects(size = 5, as = "lol") # projects 1-5 next_projects <- hca_next(projects) # projects 6-10 hca_prev(next_projects) # projects 1-5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.