Peekbank client
Peekbank client
Details
A client pins one Peekbank release, so every table read through it comes
from the same version of the data. Create one with peekbank().
Every table is reachable three ways:
pb$administrationsfor the whole table, fetched once per session and reused after thatpb$subset$administrations()to narrow it withdplyrpredicatespb$db$administrationsfor adbplyrhandle that defers transfer untildplyr::collect().
Active bindings
releaseThe Peekbank release this client is pinned to
redivis_tagThe Redivis version this client is pinned to
tablesNames of the tables in this release
subsetOne function per table taking
dplyrpredicates, e.g.pb$subset$aoi_timepoints(age < 24). A predicate can name any column of the table or of anything a row of it belongs to: an administration's dataset and subject; a trial's trial type, with its target and distractor stimuli (prefixedtarget_anddistractor_) and its AOI region set; a timepoint's administration and trial. The result has the table's own columns either way. For the timepoint tables the predicates run on the server to reduce transfer size.dbdbplyrhandles on this release's tables, one field each. They carry the same columns as the fields above, but they are lazy queries, so nothing is transferred untildplyr::collect().datasetsThe datasets table
subjectsThe subjects table. Subjects link longitudinal administrations;
administrationsis usually the one you want.administrationsThe administrations table, with
dataset_namejoined ontrialsThe trials table, with
dataset_idanddataset_namejoined ontrial_typesThe trial types table, with
dataset_namejoined onstimuliThe stimuli table, with
dataset_namejoined onaoi_region_setsThe AOI region sets table
aoi_timepointsEvery AOI timepoint in the release: 36 million rows, a little over half a gigabyte once expanded. It transfers run-length encoded and is expanded locally.
pb$subset$aoi_timepoints()filters on the server instead.xy_timepointsEvery XY timepoint in the release: 10 million rows
Methods
Method new()
Pin a database version.
Usage
PeekbankClient$new(version)Arguments
versionA Peekbank release name such as "2025.1", or "current" for whichever was published most recently. Required: see
peekbank().
Method images()
Download the stimulus images of this release's stimuli
Usage
PeekbankClient$images(
datasets = c(),
dir = "stimulus_data",
skip_existing = TRUE
)Method readmes()
Download the README of each of this release's datasets
Usage
PeekbankClient$readmes(datasets = c(), dir = "dataset_readmes")Method clear_cache()
Drop this version's (instance's) cached tables and query results, so the next read fetches them again.
Method print()
Print the pinned release and what is reachable on it